PDA

View Full Version : JsonStore forward received data(complete response if possible) to object/function



klodoma1
14 Jun 2011, 1:15 PM
Hi all,

I am having the following problem: I have a JsonStore which has a HttpProxy. Loading data is working fine.

With the request that I deliver to this store I would like to deliver more data that I want to forward to another object. How can I do this?

For example:


var storeConfig = {
fields : ['id', 'value'],
baseParams : {},
proxy : __defaultHttpProxy__,
root : 'data',
autoLoad : true,
listeners : {

}
};


In the JSON response I deliver something like:



{
success : true,
'data' : //main store data
'other' : //some other data
'other1' : //some more data
}


data will be loaded by the store, but I would like to forward the 'other' to another object.

How can I do this? I tried some options but none worked well. Do I have to forward it from the proxy somehow?

Thanks in advance. Andrei.
[/PHP]

klodoma1
15 Jun 2011, 5:53 AM
Would be this the correct solution?



store.proxy.on('load', function( DataProxy , o, options){
console.log("This is the data:", o.reader.jsonData) ;
});