Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > treeview:how to get the selected node on javascript click event

Reply
Thread Tools

treeview:how to get the selected node on javascript click event

 
 
Naim Rizk
Guest
Posts: n/a
 
      09-20-2003


hi,
I have a treeview with nodes that contain images of a checkbox. it can
be an image of a checked or unchecked checkbox. When a user click on a
node the image of the checkbox will change from checked to unchecked and
vice versa. And of course that will be done on the client side.

i added this javasript function.

function myfunction(){
SelectedNode =
event.srcElement.getTreeNode(event.treeNodeIndex);
if (SelectedNode.ImageUrl == "image1") {
SelectedNode.ImageUrl= "image2";
else
SelectedNode.ImageUrl= "image1";
}

anyway event.srcElement.getTreeNode(event.treeNodeIndex) is returning
null.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
Naim Rizk
Guest
Posts: n/a
 
      09-21-2003


i just found that I can display a checkbox treeview by setting the
checkbox propety of the node to true. so my problem is solved. but
anyway if someone can tell we how we can get the selected node in
javascript and change the image,the text... i'll appreciate it

Naim

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
Reply With Quote
 
 
 
 
rune solheim
Guest
Posts: n/a
 
      09-23-2003
Hi,

try to use:
SelectedNode =
event.srcElement.getTreeNode(event.srcElement.clic kedNodeIndex);

instead of:
SelectedNode = event.srcElement.getTreeNode(event.treeNodeIndex);

/Rune


"Naim Rizk" <> wrote in message
news:Of%...
>
>
> i just found that I can display a checkbox treeview by setting the
> checkbox propety of the node to true. so my problem is solved. but
> anyway if someone can tell we how we can get the selected node in
> javascript and change the image,the text... i'll appreciate it
>
> Naim
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cant access TreeView Node frm Btn Click event after populating frm another click even chandrajit_in ASP .Net 0 01-03-2008 10:45 AM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
how to click a button, a node in a tree is selected HS1 Java 0 11-13-2004 09:40 PM
image button click event fires before click event of button Purvi T ASP .Net 0 10-19-2004 06:19 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57