I am trying to delete a row using the DataTables plugin
I am trying to delete a row using the DataTables plugin
![pranaysoni](https://secure.gravatar.com/avatar/092060e4d1b1b38ea6c1e1cfc75907b5/?default=https%3A%2F%2Fvanillicon.com%2F092060e4d1b1b38ea6c1e1cfc75907b5_200.png&rating=g&size=120)
I am trying to delete a row using the DataTables plugin . First I don't get the example at all.
What I have this is a user checks the row they want to delete. I do this then
var row = $('#id :checked').parents('tr');
So I get the row of the checked checkbox. Lets assume they only check one box( if multiple where choose it might be different - might need a jquery each loop).
I then try to do this
var position = GlobalVariable.fnGetPosition(row);
GlobalVariable.fnDeleteRow(position);
What I have this is a user checks the row they want to delete. I do this then
var row = $('#id :checked').parents('tr');
So I get the row of the checked checkbox. Lets assume they only check one box( if multiple where choose it might be different - might need a jquery each loop).
I then try to do this
var position = GlobalVariable.fnGetPosition(row);
GlobalVariable.fnDeleteRow(position);
This discussion has been closed.
Replies
[code]
var row = $('#id :checked').parents('tr')[0];
GlobalVariable.fnDeleteRow(row);
[/code]
note that "row" is the TR node, not a jQuery object (which is what I think is causing the problem with your code).
Allan
Your Code is note work
row is undifine
var row = $('#id :checked').parents('tr')[0];
GlobalVariable.fnDeleteRow(row);
when i use
var row = $('.Class :checked').parents('tr');
only Delete First Row