Home - Forums-.NET - FlyTreeView (ASP.NET) - how to enable/disable treeview Node by client script ?

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

how to enable/disable treeview Node by client script ?
Link Posted: 29-Oct-2007 02:44
hi,

i didn't find anyway to enable or disable a treeview node by client script. So please, if this is not possible can anyone give me a trick on how to set this same behaviour on treenodes. it's urgent

thx in advance !
Link Posted: 29-Oct-2007 04:15
What do you actually mean by \"disabled\" do you need to set some specific style to node, or disable checkbox or what?

Typically, additional nodetype \"disabledNodeType\" with specific style/behavior setting is needed to be added. And used for \"disabled\" nodes.

But this is not a client-side way.

For client side, you cannot assign this \"disabled\" nodetype to node that is already in treeview.
Instead, you can remove node from treeview, set its nodetype to \"disabledNodeType\" and insert it in place of where it was removed from.

This does not look trivial.
Link Posted: 29-Oct-2007 04:48
thank you for the answer.
As you said it looks not trivial at all so please any additional code snippet on how to do that will be really apperciated

thx again!
Link Posted: 29-Oct-2007 05:54
You should probably refer to
http://www.9rays.net/asp.net_2/treeview/miscpages/doc/ClientObjects.aspx

use
var parent = node.getParent() to get original parent.
then
var index = node.getIndex()  to get node original index
then
node.remove() to remove node from its parent
then
node.setNodeTypeID(yourdisabledNodeTypeID) to set required nodetype
then
parent.insertNode(node, index);

Hope this is what you need.
Link Posted: 29-Oct-2007 22:17
thx i'm going to try to make it
Link Posted: 30-Oct-2007 00:37
hi,

i'm changing the nodetype on server side, but that doesn't seem to work.
i have a checkboxlist and the treeview in an updatePanel.
when i change the state of a checkbox in the checkboxlist i want to change the nodetype of a specified node in the treeview.
i have the checkboxlist on autopastback set to true and in the selectedindexchanged eventhandler i affect the new nodetype to the soecfied node in the treeview, but this doesn't work ther's no exception but the node changes from nodetype in a second postback of the onselectedindexchanged of the checkboxlist not in the first one where i affect the new value.
am i missing something ?
help please, thx
Link Posted: 30-Oct-2007 02:05
I can help you.

Create a simple web project with your treeview/nodetypes/etc. and send it to flytreeview.asp ** 9rays.net
So I can modify it locally and send it back to you.
Link Posted: 30-Oct-2007 11:46
i sent at the address u specified  a sample project
thank u
Link Posted: 30-Oct-2007 21:24
Didn't receive anything.
It could be blocked by mail server.
You can also put your project to FTP:
ftp://download.9rays.net/9r_incoming/
Link Posted: 30-Oct-2007 22:46
hi,

i put it on ftp its name is : NodeTypeChangingProjectSample.zip

thx