Board Logo

Initial Open State
gbergman - 9/28/2008 at 06:11 PM

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?
Thanks,
Gary


tigra - 10/6/2008 at 07:52 PM

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)


gbergman - 10/9/2008 at 04:19 AM

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?


o_item=a_item[n];

How to place "0_item" in an "opened" state?

// collect info about all item's parents
var n_id = o_item.n_id,

Thanks,
Gary

(My programming experience is S/390 Assembler. Trying to understand this high-level stuff)


tigra - 10/9/2008 at 04:25 AM

Call o_item.select()

If you like assembler you'll enjoy the bitmaps and bit operations in the tree menu (not typical for JavaScripts)


gbergman - 10/9/2008 at 06:34 PM

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.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/