cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
thickey
Level III

Traversing a nested tree box.

I am building a dynamic tree box based on a directory structure.....so I don't know in advance how many roots and nodes there will be in the tree. The final nodes of the tree could have the same name. I then put the tree into an application.

When a user clicks on a node I want to re-create the 'Path' from that node back to the root.

 

So if someone selects say 'Ducato' I want to be returned 'Trucks - Fiat - Ducato' Similarly if you picked a node that was not the final leaf it would also work. For example selecting 'Audi' would return 'Cars - Audi' 

thickey_1-1631806721454.png

 

I can get a list of roots or the text of the item selected 

 

show((myDirTree << Get Selected) << getLabel);
show((myDirTree << getRoots) << getLabel);

And I can run a script when a selection is made.

myTree << setNodeSelectScript( 
	show((myTree << Get Selected) << getLabel);
	show((myTree << Get Roots) << getLabel)	
);

But I do not know how to get the 'path' back to the root each node takes........

 

Cheers, Troy

 

 

1 REPLY 1

Re: Traversing a nested tree box.

You can 'walk back' using the Parent message to the current display box.

 

See Help > Scripting Guide:

 

parent.PNG

Recommended Articles