-
Notifications
You must be signed in to change notification settings - Fork 781
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The modal insert dialog is hidden although onAddRow returns a string #1391
Comments
@freeboarder42, so you means if the |
@AllenFang, yes, that's what I mean :-). Anyway, my little addition works, but unfortunately the real world is async. If in |
@freeboarder42, thanks, I got your point. BTW, did you enable |
Sorry, just saw your comment. I did not enable remote mode. I solved the issue of handling errors when saving the added row via a REST API by adding a callback that is called by the Save button's onClick method. The callback itself gets a callback passed for the success, and one for the error. If the success callback is called, the onClick method proceeds (and the modal is closed). I attached the source code of my custom dialog.
Cheers Jürgen |
Fixed on You can check this to know how it work, thanks |
@AllenFang that's great, but how do i close the modal from callback ? for working around, I used jquery to trigger close button |
HI, if you call the callback with explicit string(error message), which means current operation fail so that Let me know if you have any concern. |
Ok, it worked. Thank you so much |
@AllenFang: Elegant solution :-) |
According to handleSaveBtnClick in Toolbar.js a value/object that is returned by the function assigned to onAddRow in the BootstrapTable options should lead to a notice and the modal not being hidden. This does't work. The reason is that handleAddRow in BootstrapTable.js does call onAddRow without returning the result. It should look like this:
This ensures that a value/object returned by by the function assigned to onAddRow is passed to handleSaveBtnClick. The fix works in my copy of the BoostrapTable code in a production app without issues. We can even get rid ot the (not working) hack in ToolBar.handleSaveBtnClick:
The text was updated successfully, but these errors were encountered: