21 Feb 2013 4:53 AM #1
Answered: NestedList and TreeStore 2mb local file
I am current having a problem with the size of the TreeStore's data.
I am doing an App, that needs to show a tree in a NestedList.
This data needs be show offline, so i built a json file and put it on "resources/data" folder.
However, this has became a 2.5mb file, and the NestedList has became slowly to navigate in it.
I can't think on an other way to do it.
I have already thought in use a List in the place of NestedList, and then create different files to the children, but it seens a big workaround to me.
Any of you could give me an idea?
I'm not sure if NestedList will work; you may need to intervene programmatically a little more with this proxy, creating stores on the go with a remoteFilter set to the relevant parent ID.
I'd start with a simple list example and go from there.
I would populate the websql if it hasn't already been populated at the start of the application, yes.
21 Feb 2013 6:06 AM #2
You're going to have issues just on the data being stored in memory alone, nevermind the DOM, IMO.
My workaround is to read the JSON files as raw data myself, take what I want out of the data structure, remove the rest from memory and then work with the subset I want in a sencha touch store. Easier said than done... it requires lots of fiddly code.
21 Feb 2013 6:14 AM #3
21 Feb 2013 6:20 AM #4
I'll be posting some soon when it's cleaned up.
The simple fact of the matter is that you cannot store 2.5mb of data in a sencha touch store without a significant hit to performance on some devices.
I don't like having to do it either - at all - but until there's a better way to store data subsets in sencha touch, that's what has to happen.
Either that, or store the data in a database and query it into stores as necessary using a sqlite proxy.
21 Feb 2013 12:02 PM #5
And I have another problem too.
It is required to filter the NestedList.
But to filter a 2.5mb store is realy slow. =s
21 Feb 2013 1:34 PM #6
websql/sqlite would seem to be a good solution. As you could do your filtering via db queries.