Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: Retain the state of the tree
meetppr
Junior Member

Posts: 2
Registered: 12/6/2006
Location: Bangalore
Member Is Offline
posted on 1/9/2007 at 05:40 AM Reply With Quote
Retain the state of the tree


How can i retain the state of the tree after reloading the page.

I am generating the tree dynamically from the database.
My tree consists of five levels. Once a new element has been added, i should refresh the page for the new element to get into the tree.

But once refreshed entire tree gets collapsed where as i want that corresponding new element path to be expanded in the tree.

Can anybody help me please?


Thanks
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 1/9/2007 at 05:18 PM Reply With Quote

PRO version of the script uses cookies to save/restore the state between reloads, but this will not work with dynamic data because indexing of the items shifts every time you add/remove items so data saved for one item will be applied to another. You'll need to implement some method tied to unique server side IDs of the tree items either saving the state information in cookies on the client side or in the database.
View User's Profile View All Posts By User U2U Member
meetppr
Junior Member

Posts: 2
Registered: 12/6/2006
Location: Bangalore
Member Is Offline
posted on 1/9/2007 at 09:30 PM Reply With Quote
@Tigra


I had unique id's for each of the tree items which are saved in the database.
Now can you tell me how can i open a particular path in the tree using these ID's.

I think i need a javascript function to open a particular path in the tree. But i cannot make it out how to write that function.

Can u help me?



Quote:
Originally posted by tigra
PRO version of the script uses cookies to save/restore the state between reloads, but this will not work with dynamic data because indexing of the items shifts every time you add/remove items so data saved for one item will be applied to another. You'll need to implement some method tied to unique server side IDs of the tree items either saving the state information in cookies on the client side or in the database.
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 1/9/2007 at 09:42 PM Reply With Quote

You can pass ID's to the items in the item scope settings:

['Home', 'http://www.softcomplex.com/',{'myID': 35, 'tt':'some tooltip text'}]

Then you can loop through the list of tree items (o_treeRef.a_index property) looking for that ID which can be accessed like this

var myID = o_itemRef.a_config[2]['myID'];

Once found you need to open all its parents starting from the one closest to the root.
It's not really a rocket science, but if you're not comfortable with javascript submit a support ticket and we'll give a quote for the custom coding.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos:
Frames targeting
Win help style
Free Download Free Download
Free Download Menu Builders
Online Builder
Product Documentation Documentation:
Documenation Page
Support Forum Technical Support
Support Forum
   

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004