1

Our TreeGrid has a search filter which calls this method

var aCriteria = {
    _constructor: "AdvancedCriteria",
    operator: "and",
    criteria: [
        { fieldName: "EntityName", value:entityFilterFindForm.getValue("find"), operator: "iContains" }
    ]
};
this.creator.entityFilterTree.setCriteria(aCriteria);

This works great to show the target node and all parents of the target node. Unfortunately this gives the illusion that the target node has no children, is it possible to still offer the ability to expand children of the target node?

UPDATE

The solution we had was to include a pipe delimited value of ancestors coming out of SQL and include that parameter in our criteria to search. That way the children of our search result would be included because the search string was found in their ancestor string.

stackoverfloweth
  • 6,669
  • 5
  • 38
  • 69

1 Answers1

1

I've never tried it, but reading the docs for Tree.getFilteredTree I see a parameter 'filterMode', which has two valid values:

"strict" only nodes that actually match criteria are shown. If a parent does not match the criteria, it will not be shown, even if it has children that do match the criteria

"keepParents" parent nodes are kept if they have children which match the criteria, or, in a tree with loadDataOnDemand:true, if they have not loaded children yet.

Maybe keepParents could work for your use case?

Sorry, I just realized you already have parents, but you want children. Did you already try a call to Tree.loadChildren or reloadChildren ?

Community
  • 1
  • 1
claudiobosticco
  • 413
  • 2
  • 8
  • Thank you for this information, I have not tried `loadChildren` or `reloadChildren`. I know that `setCritieria` is actually calling `setData` so the actual data at this point says children is an empty array. The solution we had was to include a pipe delimited value of ancestors coming out of SQL and include that parameter in our criteria to search. That way the children of our search result would be included because the search string was found in their ancestor string. – stackoverfloweth Apr 28 '16 at 15:34