How do I remove the row with the DataTables plugin?

I am trying to delete a row using the DataTables plugin. At first I don't get an example at all.

What I have is the user who validates the row they want to delete. I do it then

var row = $('#id :checked').parents('tr');

      

So I am getting a line of checked checkbox. Suppose they only check one checkbox (if multiple options where it might be different, may need jquery every loop).

Then I will try to do this

var position = GlobalVariable.fnGetPosition(row);
GlobalVariable.fnDeleteRow(position);

      

is always null and so I don't know how to do it.

http://datatables.net/api

+2


a source to share


1 answer


I assume that something like the following piece of code should work:

$('#id :checked').each(function(index){
   GlobalVariable.fnDeleteRow($(this).parents('tr')[0]);
});

      



I haven't tested this, but it should work with what the APIs and their examples say.

+3


a source







All Articles