I have a table which is dynamically created , there is a checkbox in each row of the table, when user click that checkbox the whole row of the dynamically created table needs to deleted.
5 Answers
$('table').delegate('tr input:checkbox', 'click', function () {
$(this).closest('tr').remove();
});
Comments
$('table.grid input:checkbox').change(function(){
$(this).parents('tr').remove();
});
3 Comments
hunter
is the ":checked" filter necessary? I guess it depends if things are checked by default. Pinu's UI should be very aggravating...
Pinu
do we need to give the id of the table?
Josiah Ruddell
I added a class selector to the table. Probably want this for all
grids. @hunter - i think i had the logic reversed. But yes depending on the default state it may not be necessary.