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

'stop running the script' in IE

1 Answer 61 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Gijo
Top achievements
Rank 1
Gijo asked on 16 Apr 2012, 06:56 PM

 

 

Hi Team,

I have the below treeview and uses 'Load On Demand' and for certian nodes it has around 5000 child nodes and are throwing the javascript error 'stop running the script'. Below are what I tried.

1. In the NodeExpand event, I changed the expand mode to 'ServerSide', it worked fine. But I need AJAX.
2. I tried setting ScriptMode="Release" but didn't work.
3. I tried PersistLoadOnDemandNodes='false' and it worked. But I want to use server side events.

Regards,
Gijo Joseph.

 

<telerik:RadTreeView ID="RadTreeView" runat="server" EnableDragAndDrop="true" 
onnodedatabound="RadTreeView_NodeDataBound"
onnodeexpand="RadTreeView_NodeExpand"
</telerik:RadTreeView>

 

 

 

 

protected void RadTreeView_NodeExpand(object sender, Telerik.Web.UI.RadTreeNodeEventArgs e)
{
  List<Node> ltChilNodes = GetListofChildNodes();
  foreach (Node node in ltChilNodes)
  {
    RadTreeNode onDemandNode = new RadTreeNode(node.Name);
    onDemandNode.Attributes.Add("Attr1", node.Attr1);
    onDemandNode.Attributes.Add("Attr2", node.Attr2);
    onDemandNode.Attributes.Add("Attr3", node.Attr3);
    onDemandNode.Attributes.Add("Attr4", node.Attr4);
    onDemandNode.Attributes.Add("Attr5", node.Attr5);
  
    onDemandNode.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
  
    e.Node.Nodes.Add(onDemandNode);
 }
  
}

1 Answer, 1 is accepted

Sort by
0
Bozhidar
Telerik team
answered on 19 Apr 2012, 01:19 PM
Hello Gijo,

This is a common issue and unfortunately we have no control over it. 

There are a couple of things you can do to get rid of the problem:
1. Use WebService LoadOnDemand, which is the fastest available LoadOnDemand mode. You can take a look at the following demo for reference:
http://demos.telerik.com/aspnet-ajax/treeview/examples/programming/performance/defaultcs.aspx 
2. Instead of loading all the child nodes at once, you can load only a portion of them at a time. I've attached a sample project demonstrating the approach.
 
Regards,
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
Gijo
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or