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

Tree node that lost focus

1 Answer 51 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Bharani Mani
Top achievements
Rank 1
Bharani Mani asked on 13 Sep 2010, 08:28 PM
Hello,
             I have a tree with several nodes. I have function OnNodeClick to get the selected node. But I also want the node that lost focus. How do I get that information?..

Thanks,
Bharani

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 14 Sep 2010, 08:09 AM
Hello Bharani,


The last selected item can be retrieved from client side "OnClientNodeClicking" handler. Save the value in a global location (Eg:HiddenField) and access it from code behind.

Client code is shown here:
<script type="text/javascript">
    function OnClientNodeClicking(sender, args) {
        var text = args.get_node().get_text();
        if (sender.get_selectedNode() != null)
            alert(sender.get_selectedNode().get_text()); // get the last selected node
    }
</script>



-Shinu.
Tags
TreeView
Asked by
Bharani Mani
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or