Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    14.1 TreeGrid fetchMode and keepParentsOnFilter

    Hi,
    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)); });
    According to the documentation of setKeepParentsOnFilter:
    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.
    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
    Code:
    if (this.keepParentsOnFilter && !(this.isPaged() || this.isLocal())) { this.fetchMode = "local"; }
    14.1
    Code:
    if (this.keepParentsOnFilter //>ISC_140 && !this.shouldCacheSkeleton() //<ISC_140 ) { this.fetchMode = "local"; }
    Thanks for your help.

    #2
    We have just committed a fix for this issue, will be present in 14.x and 15.0 builds as of tomorrow (builds dated March 19 and later). Please try with your use case and let us know if you still see any issues

    Comment


      #3
      We've confirmed that the issue is fixed on the latest nightly builds.
      Thanks for your response.

      Comment

      Working...
      X