This is a migrated thread and some comments may be shown as answers.

OnNodeSelected client-side event?

2 Answers 73 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 15 Sep 2008, 04:58 PM
Hi,I try to do something extremely simple. Write texte of the selectedNode on node change intotextbox field. But, i had no OnSelectedNodeChanged in client-side API.I tried OnNodeClicked, but the result not good if i scroll with keyboardSorry for my bad english...Help me please.$0

2 Answers, 1 is accepted

Sort by
0
Simon
Telerik team
answered on 16 Sep 2008, 01:15 PM
Hi Allin,

Yes, RadTreeView does not support OnClientNodeSelectedChanged event but a similar functionality can be achieved.

Handle the OnClientNodeClicked event and keep track of the last clicked Node (note: Nodes should have some unique values that will help identifying them). In case it is changed, you can perform the needed operations related to that event. Below is the example code:

        var lastClickedNode = ""
         
        function clientNodeClicked(sender, eventArgs) 
        { 
            var node = eventArgs.get_node(); 
             
            if (node.get_value() != lastClickedNode) 
            { 
                //Selected Node changed:: 
                 
                //Track the last clicked Node: 
                lastClickedNode = node.get_value(); 
                 
                //Perform additional operations:... 
            } 
        } 

Kind regards,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jack
Top achievements
Rank 1
answered on 16 Sep 2008, 01:36 PM
Thank you Simon.$0$0$0$0I block the keyboard on treeView and i implement this solution for my application.$0$0$0$0$0$0$0
Tags
TreeView
Asked by
Jack
Top achievements
Rank 1
Answers by
Simon
Telerik team
Jack
Top achievements
Rank 1
Share this question
or