Edit this page

Using Custom Attributes Client-side

Access custom attributes on the client side by using first the get_attributes() method. Then extract the specific attribute with the getAttribute() method, passing the attribute name.


The custom attribute's name should not be an HTML reserved word. Please see the Troubleshooting Custom Attributes article for more information.

The example below demonstrates accessing the node attributes within the OnClientNodeClicked event handler.

RadTreeView OnClientNodeClicked Event

<telerik:RadTreeView RenderMode="Lightweight" ID="RadTreeView1" runat="server" OnClientNodeClicked="onNodeClicked">
        <telerik:RadTreeNode runat="server" Text="Red Oak" ScientificName="Quercus rubra">
        <telerik:RadTreeNode runat="server" Text="Eastern Red Cedar" ScientificName="Juniperus virginiana">
        <telerik:RadTreeNode runat="server" Text="Lacebark Elm" ScientificName="Ulmus parvifolia ">
function onNodeClicked(sender, args)  
    var node = args.get_node();    
    //you can also set attributes, like:

See Also

Is this article helpful? No Yes
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article