以编程方式在制表符中显示标题过滤器

问题描述 投票:0回答:1

我正在将Tabulator用于带有远程分页的Ajax请求。使用标题过滤器时,仅过滤该页面上的数据。我想做的是,当我的答案只有一页时,如果标题页超过一页,则显示标题筛选器。用户可能会感到困惑,因为他正在筛选所有数据,而不仅仅是该页。

是否有方法以编程方式设置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},
    ]
});
tabulator
1个回答
0
投票

您将需要为受影响的列更新列定义,这可以使用updateColumnDefinition函数并指定列的字段在表上完成:

table.updateColumnDefinition("name", {headerFilter:false})

或者如果您具有列组件,则可以在列上调用updateDefinition函数

column.updateDefinition({headerFilter:false}) 

可以在Column Documentation中找到有关此内容以及其他列定义信息的更多信息,>

© www.soinside.com 2019 - 2024. All rights reserved.