0
어떻게 든 여러 매장/json 요청을 같은 저장소에 포함시킬 수 있습니까? 예를 들어 Sencha Touch 2 : 같은 저장소에있는 두 개의 REST 요청
내가 JSON 객체를이 API 반환 한 그 :{"name":"john"},{"name:"harry"}
{"name":"peter"},{"name:"fred"}
내가 위해 하나 개의 저장소에 API1와 API2의 결과를 병합 할 단일보기에서 처리하기 위해 모두 연결됩니다. 결과 :
{"name":"john"},{"name:"harry"},{"name":"peter"},{"name:"fred"}
아니면 연결된하지만 동시에이 두 API를 호출 단일 뷰에 표시 할 수 없습니다 :이 가능 존 해리 피터 프레드
?
내가 더 성공이 노력하고있어 :
Ext.application({
name: 'sencha',
views: ['Main1'],
models:['AdModel'],
stores:['AdStore1','AdStore2'],
launch: function() {
var store1Obj = Ext.getStore('AdStore1');
var store2Obj = Ext.getStore('AdStore2');
store1Obj.each(function(record){
var copiedRecord = record.copy();
store2Obj.add(copiedRecord);
});
Ext.create('Ext.DataView', {
fullscreen: true,
store: store2Obj,
itemTpl: '<tpl for="."><div><strong>{name}</strong></div></tpl>'
});
}
});