Tree View Navigation Example
- Add a Tree View component to a docked window.
Set up some objects using the Tree View customizer. In the image below, there are four objects, each corresponding to a different window.
From Property Editor, find the Items property and click on the Dataset Viewericon.
This brings up a dataset editor. You will see a number of columns that identify how each tree view item is displayed, similar to the customizer where each row corresponds to a node in the tree view.
Add a column to the dataset using the Add Columnicon. Call the column windowPath and set it to column position 0. For each row, give it a value of the path to the window within the project browser.
You can then add a script that will use the newly added windowPath to open the correct window when a user double clicks on a node. Right click on the Tree View component and select Scripting.
Select the mouseClicked event handler, and add the following script to the Script Editor tab.
Click OK. Now you can save your project and test out the component.
Adding New Nodes to the Navigation Tree
If you need to add new nodes to the tree, you can still add them with the Customizer, but you will notice that the windowPath column we added does not show up. This is because the customizer only recognizes a certain set of columns, and ignores the others. So after adding new nodes with the Customizer, simply open up the dataset to provide values for the windowPath.