Data Table Editor Event
Data Table Editor Event
mazoon
Posts: 1Questions: 1Answers: 0
Hi,
I am trying to check some condition before allow user to click "New" button
Editor.on('initCreate', function () {
if (SelectStatus !== 'Y') {
alert("Pleae Select !!!!!!");
return false;
}
else
return true;
});
I am getting alert but after alert it shows Lightbox for adding new record.
How to prevent show the lightbox dialog if condition not match ??
This discussion has been closed.
Answers
The
initCreate
event is not cancellable which is why the above code won't really do anything. Instead, what you need to do is use thepreSubmit
event which is cancellable and will stop the user from being able to submit without your condition being satisfied.Allan