我正在使用 jQuery dataTable,当用户选择一个下拉列表时,它会搜索数据表并对其进行过滤并根据搜索到的数据重新绘制内容:
mtTable.columns().each(function() {
mtTable.column(22).search(searchVal, true, true).draw();
});
现在我试图在搜索完成后获取所有列值,但是我找不到执行此操作的函数。目前我正在使用 api
var myTable = $("#tblResults").DataTable();
var resultsArray = myTable.columns(colIndex).data();
根据文档,这将返回未过滤列中的所有数据。我找不到一个函数来给我一个过滤数据的列值数组。