Expanding Treegrid on user entered data

Hello Isomorphic,

We have a requirement related to databound treegrid, to be expanded upto a user selected node.
We have a datasource which has a ‘primaryID’ field as the primarykey and there is another field called as ‘levelId’ which is just a text field and not shown on treegrid.
Tree grid can expand upto 5 levels max as of the current requirement.

Screen shows a dynamic form with 5 text boxes and the tree grid below this form. Please have a look at attached image.

User can enter some value in the textboxes which are the values for ‘levelId’ which are basically the 5 different levels in tree and click on the expand tree button link. These are not the primary key fields in the datasource.
After clicking this, the tree should expand till the entered levels.
If the entered data is not proper then we need to show appropriate message to user.

Please provide a resolution as to how this can be achieved.

Thank you.

You will need to create a special fetch operation (with a distinct operationID) that retrieves all the parent nodes up to the node you want to display. Then, call this operation with DataSource.fetchData(), and when the callback fires, use Tree.linkNodes() to link the nodes into the tree, which is available as TreeGrid.data.