Welcome Guest Search | Active Topics | Sign In | Register

EO Treeview initial loading and item creation causing Javascript error in browser Options
Murtaza
Posted: Thursday, November 3, 2011 1:46:32 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2011
Posts: 6
Hi EO Product Support Team,

We are using licensed version of Essential Objects pack in our project. We are loading Treeview control with a large number of nodes. The browser shows the following error when treeview is loading.

---------------------------
Windows Internet Explorer

Stop running this script?

A script on this page is causing Internet Explorer to run slowly.
If it continues to run, your computer might become
unresponsive.

Yes No
---------------------------


We have investigated for this error and it seems this is because internally EO treeview control is creating a large number of nodes in one shot. That is why it is taking a long time to complete the entire Javascript execution and causing browser to worry about time consuming script. This error given by browser is genuine. The error is easily reproducible with 500-600 nodes.

This problem is generic. The solution for this problem has been suggested in many articles on web. The solution is you should give browser a breather while executing long running script and halt time consuming processing at due intervals.

Refer this

Good solution is to use setTimeout() and load treeview nodes batch by batch internally and not in one go. It is expected that this should be handled by EO team in internal EO code because consumer of the treeview has no control over internal creation/loading of treeview nodes.

Our client has raised this as a critical item for us and we need a patch/fix as soon as possible. In one earlier thread, it has been suggested that we use "PopulateOnDemand" property of node. But the problem is we have only one root node and it contains 900-1000 child nodes. We want to show this root node in expanded mode and load all child nodes without the need of expanding root node. Thus "PopulateOnDemand" property is not applicable in our case.

Please treat this as an urgent item. Your prompt response will really be appreciated.

Regards,
Murtaza
eo_support
Posted: Thursday, November 3, 2011 8:47:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

You will need to change your TreeView structure so that you can use populate on demand. Having too many child nodes under a single node not only is a performance issue, but also a usability issue. It unnecessarily downloads too many nodes to the client and it makes it very difficult for end user to find the node they are looking for. We could try to use setTimeout to initialize them chunk by chunk, but then you would have to deal with situation where not all nodes are loaded but user can already use the TreeView, which may cause other problem. So it's not worth it.

Thanks!
Murtaza
Posted: Friday, November 4, 2011 6:47:00 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2011
Posts: 6
eo_support wrote:
Hi,

You will need to change your TreeView structure so that you can use populate on demand. Having too many child nodes under a single node not only is a performance issue, but also a usability issue. It unnecessarily downloads too many nodes to the client and it makes it very difficult for end user to find the node they are looking for. We could try to use setTimeout to initialize them chunk by chunk, but then you would have to deal with situation where not all nodes are loaded but user can already use the TreeView, which may cause other problem. So it's not worth it.

Thanks!



We are fine with setTimeout() solution you suggested. You can initialize treeview chunk by chunk - that will not be a problem for our end users because by the time they scroll to bottom nodes treeview would have already loaded all nodes. It would not take more than 5-10 seconds since we will be loading about 1000 nodes only. The change is worth doing because it would avoid annoying browser error. It would also mean that we will not have to change data structure. As I stated earlier, "PopulateOnDemand" is not applicable in our case because the end user would want to see all items in one go without the need of expanding multiple nodes and waiting.

Please go ahead and let us know when setTimeout() change can be completed at your end.

Thank you very much for your quick reply.

Regards,
Murtaza
eo_support
Posted: Friday, November 4, 2011 7:48:38 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
You misunderstood our position ---- we said "we could, but it does not worth it". So we will NOT implement that.

Thanks
Murtaza
Posted: Monday, November 14, 2011 3:39:19 AM
Rank: Newbie
Groups: Member

Joined: 11/3/2011
Posts: 6
We cannot use PopulateOnDemand by creating groups because we do not have groups in our data - moreover we want to load all items in expanded mode initially. Is there any AJAX call available at client side API using which we can stagger item creation and load half of the items from client side??

This will avoid massive execution of javascript in one call while treeview is getting created.

Murtaza
eo_support
Posted: Monday, November 14, 2011 7:25:35 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
No. You are really at a dead end here. Your only way out is to reduce the number of nodes.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.