AllenFang / AllenFang/react-bootstrap-table

beforeSaveCell hooks

Aperta
#2,103 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
JavaScript
Stelle
2.2k
Fork
761
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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](https://user-images.githubusercontent.com/11666216/76331136-66d68380-62f7-11ea-86e0-32809961a869.png)

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](https://user-images.githubusercontent.com/11666216/76331141-676f1a00-62f7-11ea-9bcb-e1ac519f7288.png)

![Screenshot_2020-03-10_14-47-15](https://user-images.githubusercontent.com/11666216/76331360-b917a480-62f7-11ea-96a0-8bb88a27e268.png)

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.