-
Notifications
You must be signed in to change notification settings - Fork 782
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
Any way to pass a callback to beforeSaveCell function? #1245
Comments
Use const options = {
handleConfirmDeleteRow: function(cb, dropRowKeys) {
//.... ask user here
if (ok) cb();
else .....
}
} |
Do you mean I should use handleConfirmDeleteRow instead of beforeSaveCell for cell editing? Do I need to include a function in this.cellEditProp? |
ah.... shit, my bad. please ignore it, sorry. For |
Just to be clear I'm trying to implement a custom confirm modal not the browser confirm. |
That would be great. So you can't pass a can't pass a callback into validator then either right? |
um~ const options = {
beforeSaveCell: function(rowIndex, fieldName, value, cb) {
//open your model and pass cb to your application
return "SOME_SPECIFIED_VALUE";
}
}
// if user confirm this editing, call the `cb` is that ok for you? |
The function doesn't seem to be firing. Do I have to specify prop for cellEditProp beforeSaveCell still? |
of course, because I doesn't implement it yet, I just want to confirm with you |
Oh sorry. I didn't understand. I'm trying to call the confirm modal using the React Confirm plugin which returns a promise. With your proposed solution can I do something like this?:
|
@CoralSilver, got it, I'll try it, if it work, I'll release in near future. Anyway, I guess it can work well :) |
Fixed on let me know if you still got any questions, thanks. |
@AllenFang Thanks so much for making that change. It works perfectly with React-Confirm. |
I want to implement a confirmation modal and block the beforeSaveCell function until the user has hit OK or Cancel button. Is there a way to do this?
The text was updated successfully, but these errors were encountered: