Hi,
I have a table with a checkbox in each row. If a single or multiple checkboxes are selected and the delete row button is pushed, the rows should be deleted. I am using the following code:
The two checks at the start work properly. When I access the row using straight javascript to check if that row has been selected and then use fnDeleteRow, I wind up deleting every row in the table. Sorry, that code was 95 iterations ago. I have tried several methods to process each row with no success. I'm really new to JavaScript/JQuery/Datatables so a little patience would be appreciated it. Any suggestions re: checking the row to delete and proceeding from there?
(Great product BTW!)
Thanks,
JR
I have a table with a checkbox in each row. If a single or multiple checkboxes are selected and the delete row button is pushed, the rows should be deleted. I am using the following code:
$("#deleteRowButton").click(function() { var numRows = $("#timesheet tbody tr").length; var numChecked = $("#timesheet tbody tr td input:checkbox:checked").length; // iterate through rows, deleting the selected rows... });
The two checks at the start work properly. When I access the row using straight javascript to check if that row has been selected and then use fnDeleteRow, I wind up deleting every row in the table. Sorry, that code was 95 iterations ago. I have tried several methods to process each row with no success. I'm really new to JavaScript/JQuery/Datatables so a little patience would be appreciated it. Any suggestions re: checking the row to delete and proceeding from there?
(Great product BTW!)
Thanks,
JR