Board Logo

How to open a sub item without users click?
XDeveloper - 9/15/2004 at 01:23 PM

Hello, I would like to expand some sub items when the page is loaded without users click.

I am using the tree menu (free version) and not using frames!

My initial page has a menu like this:
- Animals
- Colors (clicking here just expands the sub items without reload the document) after click... it looks like this:
- Animals
- Colors
|- Blue (clicking here goes to a new page)
|- Green
|- Yellow

In the "Blue Page" the same menu is loaded again, but the item "Colors" appear closed.

I would like to execute an "automatic" opening.

Can anybody tell me if it is possible and if so how can i do it?



rock - 9/15/2004 at 01:51 PM

PRO version of the product easily handles the issue. Free version has limited facilities to implement the feature. You should operate with items' ids (index of item in the internal item collection array). E.g. in your sample root item has id 0, animals folder has id 1, and so on in order of declaration in the tree_items structure.
So to expand node with id N you should call:
var mytree = new tree(...); //mytree var definition
mytree.toggle(N) //toggles the node
//or directly open the item
var o_item = mytree.a_index[N];;

Back to forum: