PDA

View Full Version : Filling 2 Stores with one request



1099511627776
28 Dec 2011, 11:01 AM
So the subject is:
I have 2 stores
How can I fill them with one AJAX request.
I now that there is a root property of proxy object that can be set to divide data of those stores but, when I try to do that there are always 2 requests

mitchellsimoens
28 Dec 2011, 11:10 AM
You can have one store load in one root just normal. Then you have to get the other root to load that into the other store. To get something off the raw data you should use createAccessor on the reader. This is how it gets the total and success properties.


this.getOtherRoot = this.createAccessor('otherRoot');

Now you have a getOtherRoot method on the reader that will fetch the the root 'otherRoot'. Now you just have to execute this passing in the raw data.

1099511627776
28 Dec 2011, 11:22 AM
Could you please point me to some tutorial or documentation link about the subject