PDA

View Full Version : TreeStore load from custom JSON



ultra2
28 Nov 2011, 11:58 AM
I have Tree panel with a TreeStore. As I see to load a TreeStore I need to get a nested json structure
from the server. But that way would always force me to send the COMPLETE tree structure from the
server. When I refresh the TreeStore I only get the changed records from the server not the whole tree structure (I send a timestamp of the last refresh as a load parameter to the server).

Is there any way to have a custom method in the TreeStore (or in the proxy, or in the reader) where I would get the incoming records and manually merge them into the TreeStore and skip the original method?

thx

tobiu
28 Nov 2011, 12:13 PM
well, you can create a custom reader, although this is not a fast to solve task (depending on your skill level). as a start take a look at:

http://docs.sencha.com/ext-js/4-0/source/Reader.html#Ext-data-reader-Reader

and

http://docs.sencha.com/ext-js/4-0/source/TreeStore.html#Ext-data-TreeStore

ultra2
7 Dec 2011, 1:28 PM
Thanks, It's done! I inherited from TreeStore, overrided that at some point.