This is a migrated thread and some comments may be shown as answers.

[Solved] How to set the initial visibility state of node to HIDDEN when loading tree server-side

1 Answer 91 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Paul Howell
Top achievements
Rank 1
Paul Howell asked on 31 Oct 2009, 04:03 PM
i am trying to load a tree server-side in a code behind page and need to set certain nodes to be initially hidden from the user. they are made visible based on the answers to certain questions via javascipt client-side (which works fine). i cannot figure out how cause them to be initially hidden or to set a css class on the <LI>. by appending "tree_node_hidden" to the CssClass property of the node - this only causes the caption to be hidden and does not collapse the node.

mynode.CssClass +=

" tree_node_hidden "

 


results in this...

<li class="rtLI"><div class="rtMid">
   <span class="rtSp"></span><img src="../images/eforms_blank.gif" alt="" class="rtImg" /><span class="rtIn tree_node tree_node_hidden">Employer</span>
  </div></li>

thanks for any help

paul

1 Answer, 1 is accepted

Sort by
0
Schlurk
Top achievements
Rank 2
answered on 02 Nov 2009, 10:22 PM
Although it is not mentioned in the documentation you can use set_visible(true) (shown) and set_visible (false) (hidden) on Node objects to show/hide them. I'm not sure which event you are subscribing too but I have been using the functions above to take care of this client-side.
Tags
TreeView
Asked by
Paul Howell
Top achievements
Rank 1
Answers by
Schlurk
Top achievements
Rank 2
Share this question
or