dhtmlxTree common cookie

Hi everyone!

I’m developing a left menu that use dhtmlxTree and it tries to be a common menu to all pages of my site, to save the open state of menu i’m using cookies but my problem is that dhtmlxTree with loadOpenStates and saveOpenStates create one cookie for each page, right?

My question is: Could be possible use only one cookie to all pages site and load it in every page? Having the same tree open stat to each page (common cookie to all pages). Some idea?

Thanks!

Hi,

You can define cookie parameters in the second parameter of saveOpenStates and specify cookie name in the first parameter. By default, tree creates cookie with treeOpenStatex name without any parameters. So, loadOpenStates will open the same nodes in all pages (ids should be the same in all trees).

Thank you so much Alexandra!

I will try it and I hope it works for me :wink:

Thanks again!