看起来应该很容易,但是...
有没有人知道如何从筛选后的数据表中返回当前行?oTable.fnGetNodes()
方法返回所有行,而我只想返回已筛选的(可见的,但包括分页的)。
// filter on division
var oTable = $('#summary-table').dataTable();
oTable.fnFilter(division_text, 2, true);
// Get the nodes from the table
var nNodes = oTable.fnGetNodes(); // <-- still retrieves original list of rows
我查看了:Retrieving visible data from Datatables,但是帮助不大。
$("#mydatatable").DataTable()._('tr',...);
会出现TypeError: $(...).DataTable(...)._ is not a function
。 - user9645