Override 'Create' button in Create new entry
Override 'Create' button in Create new entry
rshun
Posts: 44Questions: 9Answers: 0
How can I override the 'Create' button? If I just want to submit data without close the form.
this.submit() only submit data and close the form
I also want to create a 'Clear Form' button, how can create a clear form button?
Thank you.
This question has accepted answers - jump to:
This discussion has been closed.
Answers
You could do something like this (based on code from this thread): http://live.datatables.net/heqivecu/1/edit
You'll see two buttons in the
formButtons
, that are behaving as you want,Colin
Thank you, Colin.
I want to make "Clear form" to have Events - unsaved changes close confirmation
like this example: https://editor.datatables.net/examples/api/confirmClose.html
Now I try,
this.close();
this.create();
unsaved changes not working properly.
Is it possible to override close()?
So I can
fn: function() {
var that = this;
this.close(function() {
that.create();
});
}
Thank you for your help.
Rick
I've added that code into the example here: http://live.datatables.net/heqivecu/2/edit
You'll see it's asking for confirmation like the other example you pointed to, so hopefully that'll do the trick,
Colin
Thank you for your code. It is working.
Rick