【发布时间】:2019-07-03 09:57:22
【问题描述】:
我需要一个快速搜索过滤器,用户可以在其中选择要搜索的列。我没有成功实现这种行为。 我试过这个:
this.columns.forEach(column=>{
if (this.globalSearchSelectedColumns.indexOf(column.field)>-1) column.getQuickFilterText = (params)=> params.value.name;
else column.getQuickFilterText = ()=> '';
});
this.grid.api.setColumnDefs(this.columns);
this.grid.api.onFilterChanged();
this.grid.api.resetQuickFilter();
其中 this.columns 是定义的列,this.grid 是 gridOptions,this.globalSearchSelectedColumns 是要搜索的选定列,按 column.field。
【问题讨论】:
标签: ag-grid