Tree node that lost focus

2 posts, 0 answers
  1. Bharani Mani
    Bharani Mani avatar
    40 posts
    Member since:
    Dec 2009

    Posted 13 Sep 2010 Link to this post

    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
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 14 Sep 2010 Link to this post

    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.
Back to Top