JSON 응답에서 생성 된 javascript 객체는 load
이벤트가 발생하면 yourStore.reader.jsonData
에서 사용할 수 있습니다. 예를 들면 :
yourStore.on('load', function(firstStore) {
var data = firstStore.reader.jsonData;
otherStore.loadData(data);
thirdStore.loadData(data);
}
편집 : 가 명확히하기 위해, 각 점포가 (당신이 이미하고있는) 별도의 root
속성을 필요 그래서 그들은 각각의 구성 데이터를 얻을 것입니다.
var conn = new Ext.data.Connection();
conn.request({
url: '/myserver/allInOneAjaxCall',
method: 'POST',
params: {
// if you wish too
},
success: function(responseObj) {
var json = Ext.decode(responseObj.responseText);
yourStore1.loadData(json.dataForStore1);
yourStore2.loadData(json.dataForStore2);
},
failure: function(responseObj) {
var message = Ext.decode(responseObj.responseText).message;
alert(message);
}
});
그것은 나를 위해 일한 : 아래 그림과 같이
{
"firstRoot": [...],
"secondRoot": [...],
"thirdRoot": [...]
}
출처
2009-11-07 20:43:40
wes