delete without confirmation
delete without confirmation
I want to delete a selected row with a button without a confirmation popup. My code so far is:
{ sExtends: "select_single",
sButtonText: "Remove",
fnClick: function ( button, config ) {
var rows = table.rows( '.selected' );
rows.delete();
}
},
but now a confirmation popup appears. Is it possible to delete the selected row without any confirmation?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
What you would need to do is use the
remove()method rather thanrow().delete(). The reason being is thatrow().delete()doesn't provide an option to not show the Editor form (an oversight on my part that I will fix).So you might do something like
editor.remove( table.rows('.selected').indexes(), false ).submit();.Allan
Great! Works like a charm!
Hi Allan,
I have exactly the same need as Olan, but can I use the piece of code you provided within a RESTful Editor interface like:
Yes. Keep in mind that if multiple ids are submitted they will be comma separated - your API might or might not allow for that.
Allan