do not show add/edit dialog if javascript condition not met
do not show add/edit dialog if javascript condition not met
Great work guys.
I am trying to find how to check a condition on the page (via javascript) before a user tries to add or edit a row to a datatable.
I am thinking the check should be in the editor.on( 'onInitCreate', function(){...}) function.
Within there (if indeed that is where to put it), how do I say: if (false){ "do not continue opening the add/edit window; notify user that the condition has not been met;}
?
Thank you!
This discussion has been closed.
Answers
hello?
The
open
event is the one you want.initCreate
and friends do not have the ability to disallow editing - whileopen
does, by returning false.Regards,
Allan
I'm sorry.. that does not work. I added:
editor.on("open", function(){
return false;
});
and I can still open any editor (add, edit) I want... :-\
Sorry - my mistake. I should have linked to
preOpen
. Theopen
event is triggered after the form has been shown!Allan