如何使用jquery datatable插件删除当前行 [英] How to delete current row with jquery datatable plugin
本文介绍了如何使用jquery datatable插件删除当前行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我调用 fnDeleteRow
它似乎第一次工作,但没有任何进一步的时间,那行,所以它看起来像不是真正删除行正确。
解决方案
尝试这样:
var row = $(this).closest(tr ).get(0);
oTable.fnDeleteRow(oTable.fnGetPosition(row));
如果不起作用,请检查以下示例
I have a column with buttons in a table I'm using jQuery datatable plugin. The buttons say "Remove" and the idea is that when you click on that button it deletes the current row in the table.
When I call fnDeleteRow
it seems to work the first time but no any further time for that row so it looks like its not really deleting the row properly.
解决方案
Try this:
var row = $(this).closest("tr").get(0);
oTable.fnDeleteRow(oTable.fnGetPosition(row));
If it doesn't work, check the following example
这篇关于如何使用jquery datatable插件删除当前行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文