如果行存在于下一页或其他页面 JQuery 数据表中,如何删除该行

How to delete a row if the row is present in next page or some other page JQuery datatables

我在某些页面中有行数据,例如第 3 页,但我在第 1 页,我想删除第 3.I 页中的行已尝试使用以下代码,但没有 work.please 辅助.

$('#tableid').DataTable().rows($('#idofthatrow')).remove().draw(false);

jQuery $() 方法将不起作用,因为 DOM.

中不存在当前页面以外的页面行

API 方法 row() and rows() accept row ID as an argument, see row-selector 文档。

您的代码可以重写为:

$('#tableid').DataTable().row('#idofthatrow').remove().draw(false);