Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
130
How To: use onmouseover event to expand nodes, instead of click event
posted

I'm looking to expand the nodes of my web data tree with an client side onmouseover event, similar to the way the web data menu does. Also, I would want it to collapse onmouseout of the node itself, or the child nodes.

I want the functionality of the data tree, that is why I'm using it, but I just don't want the users to have to click to expand the nodes.

I'm very new at infragistics controls, and haven't learned much about the client-side functionalities.

Any help would be appreciated. Thanks

  • 3115
    Offline posted

    For the case you explained above, it's better to use client events on WebDataTree - NodeHovered and NodeUnhovered. You should have EnableHotTracking property of WebDataTree set to true to have theese events fired. Here is sample of javascript functions you can use in your case, tested and working:

     <script type="text/javascript">

    function onNodeHovered(sender, args)

    {

    var hoveredNode = args.getNode();

    hoveredNode.set_expanded(true);

    }

    function onNodeUnhovered(sender, args)

    {

    var hoveredNode = args.getNode();

    hoveredNode.set_expanded(false);

    }

    </script>