【发布时间】:2016-03-11 07:23:23
【问题描述】:
我在使用数据表的过滤功能时遇到了困难。我使用版本 1.10。这是我尝试过的:
$("#hide").click(function() {
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
return $(table.row(dataIndex).node()).attr('data-user') == 5;
}
);
table.draw();
});
$("#reset").click(function() {
$.fn.dataTable.ext.search.pop();
table.draw();
});
但是表格没有更新。有什么我可能做错了吗?当我执行 console.log 时,有问题的数组似乎正在更新,但没有迹象表明该函数被调用。
非常感谢!
【问题讨论】:
标签: jquery datatables