简体   繁体   中英

Massload with Open_all in JSTree and Lazy Loading

I am using JSTree in my application.

I have very huge data to be displayed in JSTree.

I have around 200 000 nodes to be displayed.

I provided search functionality to user. Upon search I am clearing previous instance of jstree and creating new instance with required data.

On Loaded event which is fired when "Root" node is loaded I am calling open_all() method to open all nodes,

I have huge data and I am using lazy loading. So for example in one case I have 20K nodes inside one node. So it makes 20K ajax request which ultimately leads to "ERR_INSUFFICIENT_RESOURCES".

How can I integrate massload functionality over here with open_all()?

There is nothing special that you need to do - provided massload is configured in your instance it will intercept the call that happens after the search and load needed nodes in a single batch. This will however not work for open_all as jstree does not know the IDs in advance.

But since you are creating a new instance, and then invoking open_all on it - why do you even add lazy loading to that instance? You are loading all the nodes anyway - simple return the whole structure when the request for the root comes in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM