All Products
Demos
Pricing
Services
Blogs
Docs & Support
Search
Shopping cart
Login
Contact Us
Get A Free Trial
close mobile menu
Telerik Forums
/
UI for ASP.NET AJAX Forum
/
TreeView
/
Retrive a nodes attributes fails
Cancel
Telerik UI for ASP.NET AJAX
Resources
Buy
Try
Feed for this thread
2 posts, 0 answers
Andrew
3 posts
Member since:
Apr 2009
Posted 27 May 2009
Link to this post
I am using the following script to try to access the nodes attributes but I get an error get_attributes is not a function. When I check the node in fire bug the is defiantly no get attributes function where am I going wrong?
function onNodeClicked(sender, args)
{
var
node
=
args
.get_node();
alert(node.get_attributes().getAttribute("CategoryOf"));
//you can also set attributes, like:
//node.get_attributes().setAttribute("CategoryOf");
}
Veselin Vasilev
Admin
2992 posts
Posted 27 May 2009
Link to this post
Hello Andrew,
I could not reproduce the problem in a simple scenario:
<
telerik:RadTreeView
ID
=
"RadTreeView1"
runat
=
"server"
OnClientNodeClicked
=
"onNodeClicked"
>
<
Nodes
>
<
telerik:RadTreeNode
Text
=
"root"
CategoryOf
=
"my custom attribute"
>
</
telerik:RadTreeNode
>
</
Nodes
>
</
telerik:RadTreeView
>
<
script
type
=
"text/javascript"
>
function onNodeClicked(sender, args)
{
var
node
=
args
.get_node();
alert(
node.get_attributes().getAttribute("CategoryOf")
);
}
</
script
>
Can you tell us what is different in your case?
Greetings,
Veselin Vasilev
the Telerik team
Instantly find answers to your questions on the new
Telerik Support Portal
.
Check out the tips
for optimizing your support resource searches.
Back to Top
Close