Hi,
Using SmartGWT 14.1p-20250310, we're observing what we think is a defect in the behaviour of TreeGrid filtering.
According to the documentation of setKeepParentsOnFilter:
with FetchMode.PAGED explicitly specified we'd expect to get a request server-side when clicking on a cell of the grid. What we're actually observing is the grid attempts to filter locally.
We've tracked down this change in resultTree.init() in ISC_DataBinding.js:
13.0
14.1
Thanks for your help.
Using SmartGWT 14.1p-20250310, we're observing what we think is a defect in the behaviour of TreeGrid filtering.
Code:
TreeGrid grid = new TreeGrid(); grid.setDataSource("Content"); grid.setAutoFetchData(true); grid.setDataFetchMode(FetchMode.PAGED); grid.setKeepParentsOnFilter(true); grid.addCellClickHandler(event -> { grid.filterData(new AdvancedCriteria("parentId", OperatorId.EQUALS, 1L)); });
If FetchMode is explicitly set to "paged", it is not possible to implement keepParentsOnFilter by local filtering. Support for keepParentsOnFilter for a paged ResultTree therefore also requires custom logic in the DataSource fetch operation. To support this a developer must ensure that their fetch operation returns the appropriate set of nodes - all nodes that match the specified criteria plus their ancestor nodes even if they do not match the specified criteria.
We've tracked down this change in resultTree.init() in ISC_DataBinding.js:
13.0
Code:
if (this.keepParentsOnFilter && !(this.isPaged() || this.isLocal())) { this.fetchMode = "local"; }
Code:
if (this.keepParentsOnFilter //>ISC_140 && !this.shouldCacheSkeleton() //<ISC_140 ) { this.fetchMode = "local"; }
Comment