cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • JMP will suspend normal business operations for our Winter Holiday beginning on Wednesday, Dec. 24, 2025, at 5:00 p.m. ET (2:00 p.m. ET for JMP Accounts Receivable).
    Regular business hours will resume at 9:00 a.m. EST on Friday, Jan. 2, 2026.
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.

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