当我使用selectvalue API对基于集合的过滤器进行编程控制时,浮动过滤器窗口不会更新。
如果您手动从浮动过滤器窗口中选择和取消选择,则可以正常工作。
请参阅https://plnkr.co/edit/707g7FHCPOOi26AlUpyn?p=preview
点击API: Filter only John Joe Nevin和Kenny,它将正确过滤,但用于运动员的浮动过滤器框是空的。
如果你打开旁边的漏斗,过滤器是正确的。取消选择某项,然后选择其他项,运动员的名字就会正确地出现在浮动过滤器输入框中。
我是不是遗漏了什么?
//Code used to perform the filter.
var athleteFilterComponent = this.gridApi.getFilterInstance("athlete");
athleteFilterComponent.selectNothing();
athleteFilterComponent.selectValue("John Joe Nevin");
athleteFilterComponent.selectValue("Kenny Egan");
this.gridApi.onFilterChanged();
//Turn this option on as well.
floatingFilter='true'发布于 2019-08-11 13:07:20
这可能是ag-grid中的一个bug。
不过,解决方法是使用setModel()应用编程接口。像这样的东西起作用了-
selectJohnAndKenny() {
var athleteFilterComponent = this.gridApi.getFilterInstance("athlete");
athleteFilterComponent.selectNothing();
var model = ["John Joe Nevin", "Kenny Egan"];
athleteFilterComponent.setModel(model);
this.gridApi.onFilterChanged();
}https://stackoverflow.com/questions/57423313
复制相似问题