如何在 mui-datatables 中添加自定义搜索,可用于从 API 获取的数据。你能给我一个工作的例子吗?我尝试使用
customSearch: (searchQuery, currentRow, columns) => {
let isFound = false;
currentRow.forEach(col => {
if (col.toString().indexOf(searchQuery) >= 0) {
isFound = true;
}
});
return isFound;
},
在选项中。
注意:在控制台中,我得到了 react_devtools_backend.js:6 服务器端过滤已启用,因此将忽略自定义搜索。