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

Load-on-Demand Node clicked multiple times

1 Answer 14 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Cf
Top achievements
Rank 1
Cf asked on 26 Feb 2013, 07:17 AM
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?

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 26 Feb 2013, 02:06 PM
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.
Tags
TreeView
Asked by
Cf
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or