在 Ag Grid 中隐藏过滤器行
Hide filter row in Agrid
我无法隐藏浮动筛选行。
即使没有启用过滤器,您也会注意到空行。
演示地址:https://plnkr.co/edit/6bGd5RHKuI9Th1cN
演示源与默认演示相同https://www.ag-grid.com/javascript-grid-floating-filters/
唯一的例外是在 columnDefs 变量声明代码之后添加了以下行,以隐藏列
this.columnDefs.forEach(c => (c.filter = false));
还是Ag-grid问题?
发布图片:
有什么想法吗?
根据文档:Floating Filters
Floating Filters are an additional row under the column headers where the user will be able to see and optionally edit the filters associated to each column.
Floating filters depend on and coordinate with the main column filters.
因此,当您在网格级别设置 [floatingFilter]="true"
时,将显示额外的行。但是,由于您为每一行设置了 filter = false
,因此该行将保持为空。
如果您想隐藏该行,您将按照这个 plunk 设置 属性:https://plnkr.co/edit/AriPNpPsWs0zuISI
this.floatingFilter = false;
<ag-grid-angular
#agGrid
...
[floatingFilter]="floatingFilter"
...
></ag-grid-angular>
我无法隐藏浮动筛选行。
即使没有启用过滤器,您也会注意到空行。
演示地址:https://plnkr.co/edit/6bGd5RHKuI9Th1cN
演示源与默认演示相同https://www.ag-grid.com/javascript-grid-floating-filters/ 唯一的例外是在 columnDefs 变量声明代码之后添加了以下行,以隐藏列
this.columnDefs.forEach(c => (c.filter = false));
还是Ag-grid问题?
发布图片:
有什么想法吗?
根据文档:Floating Filters
Floating Filters are an additional row under the column headers where the user will be able to see and optionally edit the filters associated to each column.
Floating filters depend on and coordinate with the main column filters.
因此,当您在网格级别设置 [floatingFilter]="true"
时,将显示额外的行。但是,由于您为每一行设置了 filter = false
,因此该行将保持为空。
如果您想隐藏该行,您将按照这个 plunk 设置 属性:https://plnkr.co/edit/AriPNpPsWs0zuISI
this.floatingFilter = false;
<ag-grid-angular
#agGrid
...
[floatingFilter]="floatingFilter"
...
></ag-grid-angular>