PDA

View Full Version : NestedList/TreeStore with large static dataset timesout on iPad



mnjacobs
29 Oct 2010, 11:12 AM
My application has a large static tree structure (17,000 nodes) each containing several fields. This is intended to be a standalone application eventually, so the static tree must be delivered locally (not via a back-end). The application starts in seconds on the desktop, but fails with a 'JavaScript execution timeout' on the iPad (when served via Google App Engine if that even matters). I have been able to determine that the TreeStore constructor reads all of data based on the root object (using the private doPreload option).

Is there a way for me to defer the full population of the TreeStore by using TreeStore.load() and the NestedList events to populate the tree as needed instead? Any other options to optimize the loading of a huge dataset like this? I have tried using only a single field in each node (with hopes of using implicitIncludes for associations) but even that times out on the iPad.

Thanks,
Mike

mitchellsimoens
30 Oct 2010, 6:57 AM
You think that mobile devices really would render 17,000 nodes? Mobile devices are getting more powerful but they just simply cannot match a desktop or laptop. I'm thinking you may just be asking too much from the iPad. Just my thoughts

mnjacobs
1 Nov 2010, 12:54 PM
It appears to be that the NestedList only maintains enough nodes to render the current tree level, so only a small fraction of the total would ever be rendered. My challenge is that the TreeStore appears to always preload all supplied data. I would like to find a way to spread that pain as the tree is navigated.

I am having trouble figuring out the most appropriate extension point or approach to accomplish this. The TreeStore documentation is pretty light when it comes to adding new data to the store.

mnjacobs
8 Nov 2010, 12:31 PM
For what it's worth, I was able to solve this problem by creating a custom Proxy. The data build process creates the JavaScript source to create an associative array. The operation params passed to the proxy read method is used to key into the associative array to get the raw data. The raw data is then converted into Model instances by passing the raw data to the tree reader's readRecords method. The nested list then requests the data as the user navigates the tree and only the Model instances of the visited nodes are ever created.

snapshotmedia
21 Dec 2010, 3:41 AM
mnjacobs: Would you care to share your code here? I too am loading a LOT of data into a NestedList from a huge JSON file.