AllenFang / react-bootstrap-table

A Bootstrap table built with React.js
https://allenfang.github.io/react-bootstrap-table/
MIT License
2.24k stars 783 forks source link

beforeSaveCell hooks #2103

Open nthhtn opened 4 years ago

nthhtn commented 4 years ago

Hello, I just came across a problem with editable cell. I need to attach a class method to hook beforeSaveCell, intending to dispatch an action to call backend API. Then I suddenly found that there is no way to reject cell edit change, although the function returns false

Screenshot_2020-03-10_17-46-55

In this case, the cell edit update is prevented if the callback is explicitly declared inside option. It works properly.

Screenshot_2020-03-10_17-46-27

Screenshot_2020-03-10_14-47-15

But in these two cases, the hook is still triggered, but the cell is still saved even when returned value is false. Is there a bug or I do anything wrong? Please recommend for me. Thank you