TreeView with lots of nodes

Answered
1
0

Hi,

I have a TreeView with a lot of nodes. When I try to show or manipulate this the browser scripts take a long time.

I found the VirtualScroll property but setting this on my tree causes it to hang when I try to expand a node.

What is the best way to show a TreeView with a large number of nodes?

TIA

Nic

  • You must to post comments
Best Answer
0
0

Hi Tim, Hi Nic

we have put together a sample that illustrates the usage and benefits of LazyLoading and VirtualScrolling:

http://wisej.s3.amazonaws.com/support/attachments/Wisej.TreeViewLargeDataSet.zip

It requires the latest development build (1.5.42).

Please let me quickly explain what to use when and how:

  • node.LazyLoading = true means that Wisej will send its child nodes to the client only when that node is expanded.
  • node.IsParent = true makes the tree node look like it can expand (even if it has 0 child nodes).
    This allows your app to populate the child nodes on demand in OnBefore- or OnAfterExpand.
  • So the combination of node.IsParent and node.LazyLoading allows your app to show the loader icon when expanding
    and at the same time populate the child nodes on demand.

These 2 features can be used regardless of VirtualScrolling.

However if you have too many nodes, at one point, the browser itself may become sluggish.

That´s where VirtualScrolling = true comes in quite handy. It lets Wisej client side only create the elements
for the visible portion of the TreeView.

Only VisualScrolling = true makes the client faster by creating only few elements. But if the server has
to send to the client e.g. 20.000 nodes it will still take some time to transfer and parse the data.

So finally a combination of VirtualScrolling, LazyLoading and IsParent with empty nodes can solve
virtually any issue with the performance of large TreeViews.

Hope that helps.

Best regards
Frank

  • Nic Adams
    And I just have to say it works beautifully.
  • You must to post comments
0
0

Thanks Frank,

Looking forward to trying this out over the next couple of days.

Excellent service from the WiseJ team once again.

Nic

  • You must to post comments
0
0

Hi Tim, Hi Nic,

the problems with the VirtualScrolling have been fixed and the new build is in the final testing
and most likely be released tomorrow.

We will also publish a sample that shows the usage and benefit of LazyLoad and VirtualScrolling
and a few more explanations for it.

But since it requires the latest build, I will publish it right after the new release.

Thanks for your patience.

Best regards
Frank

  • You must to post comments
0
0

I am also looking forward to the new release and sample.  I had taken a look issue I was having and it was still running slow with lots of nodes on the latest version.  Hoping this takes care of my issues!

 

Thanks! Tim

  • You must to post comments
0
0

Thanks Luca,

Lazy loading sounds interesting too. I’m not sure I have 500,000 nodes but I have enough that loading them on demand would be very beneficial.

Look forward to the sample and the fix.

Thanks again

Nic

 

  • You must to post comments
0
0

It’s probably timing out.

There is a bug with the VirtualScrolling and selection. It’s fixed and will be in the next dev or release build. I tried with half a million nodes using VirtualScroling and LazyLoading and it works very well  now. In general, LazyLoading lets you populate nodes when they are expanded the first time. Virtual scrolling limits the rendering to the visible area of the control.

Wisej already sends to the client only the nodes that are made visible (the parent has been expanded) but when everything has to be rendered it becomes too heavy for the browser unless virtual scrolling is used. I’ll upload a sample here that shows the differences, that’s the one I used to test the 500,000 nodes.

  • You must to post comments
Showing 6 results
Your Answer

Please first to submit.