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.

有帮助吗?

解决方案

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 '[...]'.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top