Tree view link

I am using the following code ........

'>http://www.w3.org/1999/xhtml">

Untitled Page









borderstyle="Solid" borderwidth="1px" height="80px" width="160px"
DataSourceID="SqlDataSource1" dir="ltr" EditNode="False" ClientSideOnNodeSelect="nodeSelected(this)" >

DataMember="DefaultView"
Expanded="True"
IDField="id"
ParentIDField="parentId"
TextField="Text"
/>


ConnectionString="<%$ ConnectionStrings:local %>"
SelectCommand="SELECT [id], [parentId], [Text], [Target] FROM [Links]">





The warning is being displayed = [object Object] and not the value selected.
Where is the mistake?

tks

1 Reply

LK Lakxman Kumar C Syncfusion Team February 26, 2010 07:43 AM UTC

Hi Jorge,

Thank you for your interest in Syncfusion Products.

The ClientSideOnNodeSelect event of the treeview returns the clientside object for the selected node. That is why when the 'node' variable was alerted, [object Object] was displayed. If your intention is to alert the text of the selected node it can be done by the Text propery of the selected node. Kindly find below the modified code snippet to achieve this.

[Javascript]

function nodeSelected(node)
{
alert(node.Text);
}


Also I have created a simple sample for your convenience and it can be downloaded from the link below.

http://help.syncfusion.com/samples/Tools.Web/8.1.0.30/65127/TreeView.zip

Kindly view the above sample, reproduce it in your application and please let me know if this helps.

Regards,
Lakxman Kumar C

Loader.
Up arrow icon