Load-on-Demand Node clicked multiple times

2 posts, 0 answers
  1. Cf
    Cf avatar
    1 posts
    Member since:
    Feb 2013

    Posted 26 Feb 2013 Link to this post

    I've noticed that in my project, as well as on the online load-on-demand demo's, when the user clicks on expand multiple times, the node generates multiple loading images but only removes one of these images when the child-nodes are returned.

    How can I deal with this issue?
  2. Bozhidar
    Admin
    Bozhidar avatar
    1102 posts

    Posted 26 Feb 2013 Link to this post

    Hi,

    You can use the OnClientNodeExpanding and OnClientNodePopulated events to prevent this behavior:
    function OnClientNodeExpanding(sender, args) {
        var node = args.get_node();
     
        if (node.get_attributes().getAttribute("loading")) {
            args.set_cancel(true);
        } else if (node.get_expandMode() != 0 && node.get_expandMode() != 1) {
            node.get_attributes().setAttribute("loading", true);
        }
    }
     
    function OnClientNodePopulated(sender, args) {
        args.get_node().get_attributes().setAttribute("loading", false);
    }

     

    All the best,
    Bozhidar
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top