[Chameleon] HTML Legend with JavaScript refreshing problem

Dejan Gambin dejan.gambin at pula.hr
Sat Feb 11 06:50:49 EST 2006


Hi,

I have created my collapsible legend tree according to Paul suggestions in
one of his earlier post. It works fine except when refreshing/updating the
map, when all the folders go back to their starting "closed" state.

Jacob gave the proposal to use hidden form variables for the state of each
folder and then use a function called by body's "onload" to reset the status
to the right state. May I ask few questions to Jacob or anyone else who can
help, as I am not a JavaScript/DHTML expert:

I have created hidden form variable in [leg_group_html] section of legend
template file, something like "<input type="hidden"
name=[leg_group_name]_status value="closed">". I am changing the value in
Javscript function that deals with expanding/collapsing the folder(group).
This is fine. The problem is that I don't know how to make the function that
would reset the state of the folder after page refresh? I have something
like this in my template file, that should be changed according to
[leg_group_name]_status variable:

"<div id="[leg_group_name]_layer" style="display:none">" OR 
"<div id="[leg_group_name]_layer" style="display:block">"   

...but I don't know how to do it...any suggestion?


thanks

dejan





More information about the Chameleon mailing list