Remove a row the table without asking the user for confirmation
Remove a row the table without asking the user for confirmation
I have some code in the 'preSubmit' event that checks if there is already an existing row with the same email as the row that is currently being added. If the email does already exist, I want to delete the existing row. The following code will work for me:
editor.remove(table.row(i)).submit();
where table.row(i) is the row containing the duplicate email
The problem is that I don't want the user to have to confirm the delete, but when I try the following code (adding false as a second parameter) it doesn't ask for confirmation but it also doesn't delete the row:
editor.remove(table.row(i), false).submit();
also tried this code without the "submit()" at the end, didn't make a difference
Is this a bug?
Answers
Try using
table.row(i).index()
.In this example if I run:
It deletes the first row without confirmation.
Allan