以编程方式在制表符中显示 header 过滤器
Show header filter in tabulator programmatically
我在 Ajax 远程分页请求中使用 Tabulator。当您使用 Header 过滤器时,您只过滤该页面上的数据。我想做的是在我的答案只有 1 页时显示 Header 过滤器,如果超过 1 页,用户可能会感到困惑,因为他正在过滤所有数据,而不仅仅是该页面。
是否有以编程方式设置 HeaderFilter=true
或 false 的方法?
this.tabulator = new Tabulator(this.$refs.table, {
index: "ANRID",
data: this.tableData, //link data to table
locale: true,
height:"400px",
responsiveLayout:"collapse",
pagination:"remote",
tooltips: true,
ajaxURL: "/anrs",
responsiveLayoutCollapseStartOpen:false,
columns: [
{title:"+", formatter:"responsiveCollapse", headerSort:false},
{title:"", formatter:editIcon, width:25, align:"center", headerSort:false},
{title: "ID", field:"ANRID", headerFilter: false},
{title:"Fideicomiso", field:"fideicomiso.FondosNombre", width: 150, headerFilter: false},
{title:"Actividad", field:"actividad", headerFilter: false},
]
});
您需要更新受影响列的列定义,这可以在 table 上使用 updateColumnDefinition 函数并指定列的字段:
table.updateColumnDefinition("name", {headerFilter:false})
或者如果您有列组件,您可以在列
上调用 updateDefinition 函数
column.updateDefinition({headerFilter:false})
中找到有关此列和其他列定义信息的更多信息
我在 Ajax 远程分页请求中使用 Tabulator。当您使用 Header 过滤器时,您只过滤该页面上的数据。我想做的是在我的答案只有 1 页时显示 Header 过滤器,如果超过 1 页,用户可能会感到困惑,因为他正在过滤所有数据,而不仅仅是该页面。
是否有以编程方式设置 HeaderFilter=true
或 false 的方法?
this.tabulator = new Tabulator(this.$refs.table, {
index: "ANRID",
data: this.tableData, //link data to table
locale: true,
height:"400px",
responsiveLayout:"collapse",
pagination:"remote",
tooltips: true,
ajaxURL: "/anrs",
responsiveLayoutCollapseStartOpen:false,
columns: [
{title:"+", formatter:"responsiveCollapse", headerSort:false},
{title:"", formatter:editIcon, width:25, align:"center", headerSort:false},
{title: "ID", field:"ANRID", headerFilter: false},
{title:"Fideicomiso", field:"fideicomiso.FondosNombre", width: 150, headerFilter: false},
{title:"Actividad", field:"actividad", headerFilter: false},
]
});
您需要更新受影响列的列定义,这可以在 table 上使用 updateColumnDefinition 函数并指定列的字段:
table.updateColumnDefinition("name", {headerFilter:false})
或者如果您有列组件,您可以在列
上调用 updateDefinition 函数column.updateDefinition({headerFilter:false})
中找到有关此列和其他列定义信息的更多信息