We use a different Tree Menu Pro in each "section" of our website navigation. When clicking to a page in a different section we would like the tree
to be opened to that page.
i.e. can we code an "onload" function to open the tree to a specific location?
(having the page open the tree when the page was not opened by clicking it's own tree item)
Also, is there a way to tell if the tree is in a "collapsed" state?
one way is to set 'st' key in the items file to tell the tree what is the initial state of the particular node.
another way is to open/close nodes of the loaded tree in the browser using the API (see documentation for info and samples)
Ok, I coded an "OnLoad" statement that first collapses the tree and then opens it to the current item.
(using function openItemByCaption).
But the opened tree is not "selected".
What statement do I have to add (I assume between the following points) that will
put the found item into a "selected or Opened" state so that my CSS code will highlight it?
How to place "0_item" in an "opened" state?
// collect info about all item's parents
var n_id = o_item.n_id,
(My programming experience is S/390 Assembler. Trying to understand this high-level stuff)
Problem solved, thanks.
Some trial & error showed that
1. o_item.select(); - needed to be at end of function, not in middle where I thought.
2. The tree item definition, needs to have a 3rd parameter defined (even if null)
Syntax, why not? They tax everything else.