我们可以将搜索添加到使用TabularTables定义的表中,并使其成为caseSensitive,smart和enterOnly。但是,我没有看到在表/页面重新加载时清除搜索字段的选项。知道如何清除搜索吗?
在表格中,'stateSave'设置为true,无法关闭,因为我希望页面大小和排序在页面重新加载时保存。
https://github.com/aldeed/meteor-tabular#customizing-search-behavior
答案 0 :(得分:0)
更新onRendered或onDestroyed模板处理程序,以清除数据表状态的搜索值并重绘。
https://datatables.net/reference/api/search()
Template.your_template_name.onDestroyed(function() {
var table = $('#your_datatable_id').DataTable({
'retrieve': true
});
if (table.search() !== "") {
return table.search("").draw();
}
});