Question

I have dynatree that is working with my MVC4 WebApplcation. It gets data from controller in JSON format. Node usually has about 2'000 or 3'000 and more items. It takes several seconds to load this tree. Is there any way to show 5 items in the begining and 5 items from the end and between them to show[...]. Thank you.

Was it helpful?

Solution

You could simply only generate those 21 nodes on the server (i.e. 10 first, 10 last and one special node with title: '[...]', isPlaceholder: true. This would cause only 21 nodes to be displayed.

In the activate handler you could then check for node.data.isPlaceholder and do a complete reload if the user clicks '[...]'.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top