How would I call both the edit and create from a single button?
How would I call both the edit and create from a single button?

I'm trying to edit (soft delete) a row, and also create a new row (both makes ajax calls) from a single button.
var buttons = [ {
label: 'Delete And Create'
editor: editor,
fn: function() {
editor.field('Deleted').set(true);
editor.submit();
editor.field('Deleted').set(false);
editor.create().submit(); //This isn't working, I think the form is being cleared
}
}];
editor.edit( indexes, { buttons: buttons });
How would I be able to get a button that first edits a row, set the deleted field to true, and then, create a new row with deleted field to false?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Here is a custom button called "deleteAndCreate" that should do the job. It requires Editor's "Select" extension.
Use it like this in your data table definition: