简体   繁体   English

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

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

我在某些页面(例如第3页)中存在行数据,但我在第1页中,我想删除第3页中的行。我尝试了下面的代码,但没有用,请协助。

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

jQuery $() method will not work because rows for pages other than current do not exist in DOM. jQuery $()方法将不起作用,因为DOM中不存在当前页面以外的行。

API method row() and rows() accept row ID as an argument, see row-selector documentation. API方法row()rows()接受行ID作为参数,请参阅row-selector文档。

Your code could be rewritten as: 您的代码可以重写为:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM