View Full Version : Reading/Writing multiple stores data alltogether with json

13 Oct 2010, 12:04 AM
I have a master/detail/detail scenario, and I am going to handle this with 3 grids.

I have started with 3 json stores, and I would like the ability to load all 3 of them at once. This should be possible, in the end we should be able to return
{ success: true, data1:[{...},{...}], data2:[{...},{...},{...}],data3:[{...},{...}] }
because we can specify the root properties in the store.

My question is can ExtJS stores be configured to handle multiple types of data, or do we need to handle this on our own, in any case if you can provide me some samples I would be glad.
This scenario also applies to when writing data back to the server, instead of 3 different posts for each store, I would like to be able to send the updates at once.

13 Oct 2010, 12:23 AM

callback: function(){

Write beforesave handlers on all stores that remember that data, but return false.
After you have all data you can initiate transactions for the data yourself.

14 Oct 2010, 1:53 AM
any chance of getting the AJAX json strings to be sent.
beforesave event only gives me the data changes, I could not find an easy of converting them to json.

14 Oct 2010, 2:55 AM
You could create dummy directFns to handle the create, update and delete actions that only collect the data.

But it doesn't really matter which method you use, you're going to have to write quite a lot of code to do this, because the framework wasn't designed for this.

27 Oct 2010, 5:54 AM
I used beforesave handlers, its all good now:)