开发者

How to Delete a Row with DataTables Plugin?

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);

position is always null and So I have no clue how to do this.

http://datatables.net/api


My guess would be 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 from what the API and their examples say.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜