<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Traversing a nested tree box. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Traversing-a-nested-tree-box/m-p/418740#M66775</link>
    <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;When a user clicks on a node I want to re-create the 'Path' from that node back to the root.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if someone selects say 'Ducato' I want to be returned &lt;STRONG&gt;'Trucks - Fiat - Ducato'&lt;/STRONG&gt; Similarly if you picked a node that was not the final leaf it would also work. For example selecting 'Audi' would return &lt;STRONG&gt;'Cars - Audi'&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thickey_1-1631806721454.png" style="width: 184px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35874i9128D27CD2EB6E00/image-dimensions/184x347?v=v2" width="184" height="347" role="button" title="thickey_1-1631806721454.png" alt="thickey_1-1631806721454.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get a list of roots or the text of the item selected&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;show((myDirTree &amp;lt;&amp;lt; Get Selected) &amp;lt;&amp;lt; getLabel);
show((myDirTree &amp;lt;&amp;lt; getRoots) &amp;lt;&amp;lt; getLabel);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I can run a script when a selection is made.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myTree &amp;lt;&amp;lt; setNodeSelectScript( 
	show((myTree &amp;lt;&amp;lt; Get Selected) &amp;lt;&amp;lt; getLabel);
	show((myTree &amp;lt;&amp;lt; Get Roots) &amp;lt;&amp;lt; getLabel)	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I do not know how to get the 'path' back to the root each node takes........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Troy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 19:56:51 GMT</pubDate>
    <dc:creator>thickey</dc:creator>
    <dc:date>2023-06-09T19:56:51Z</dc:date>
    <item>
      <title>Traversing a nested tree box.</title>
      <link>https://community.jmp.com/t5/Discussions/Traversing-a-nested-tree-box/m-p/418740#M66775</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;When a user clicks on a node I want to re-create the 'Path' from that node back to the root.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if someone selects say 'Ducato' I want to be returned &lt;STRONG&gt;'Trucks - Fiat - Ducato'&lt;/STRONG&gt; Similarly if you picked a node that was not the final leaf it would also work. For example selecting 'Audi' would return &lt;STRONG&gt;'Cars - Audi'&lt;/STRONG&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thickey_1-1631806721454.png" style="width: 184px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35874i9128D27CD2EB6E00/image-dimensions/184x347?v=v2" width="184" height="347" role="button" title="thickey_1-1631806721454.png" alt="thickey_1-1631806721454.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can get a list of roots or the text of the item selected&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;show((myDirTree &amp;lt;&amp;lt; Get Selected) &amp;lt;&amp;lt; getLabel);
show((myDirTree &amp;lt;&amp;lt; getRoots) &amp;lt;&amp;lt; getLabel);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And I can run a script when a selection is made.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;myTree &amp;lt;&amp;lt; setNodeSelectScript( 
	show((myTree &amp;lt;&amp;lt; Get Selected) &amp;lt;&amp;lt; getLabel);
	show((myTree &amp;lt;&amp;lt; Get Roots) &amp;lt;&amp;lt; getLabel)	
);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But I do not know how to get the 'path' back to the root each node takes........&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers, Troy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 19:56:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Traversing-a-nested-tree-box/m-p/418740#M66775</guid>
      <dc:creator>thickey</dc:creator>
      <dc:date>2023-06-09T19:56:51Z</dc:date>
    </item>
    <item>
      <title>Re: Traversing a nested tree box.</title>
      <link>https://community.jmp.com/t5/Discussions/Traversing-a-nested-tree-box/m-p/418761#M66778</link>
      <description>&lt;P&gt;You can 'walk back' using the Parent message to the current display box.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See Help &amp;gt; Scripting Guide:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="parent.PNG" style="width: 921px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/35876iE2714CA26EB5BCD8/image-size/large?v=v2&amp;amp;px=999" role="button" title="parent.PNG" alt="parent.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Sep 2021 16:40:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Traversing-a-nested-tree-box/m-p/418761#M66778</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-09-16T16:40:09Z</dc:date>
    </item>
  </channel>
</rss>

