스토어 오브젝트는 아약스 요청을 통해 동적으로로드됩니다. 콘솔에서 디버깅하는 동안 나는 저장소 개체가 레코드로 채워지지만 리스트는이 비어 있음을 볼 수 있습니다.Sencha Touch 2. 빈 목록
코드 :
뷰포트보기
Ext.define('sample.views.Viewport', {
extend: 'Ext.tab.Panel',
title: 'Hello world!',
xtype: 'viewport',
config: {
fullscreen: true,
tabBar: {
docked: 'bottom',
},
items: [
{ xclass: 'sample.views.wares.lists.Popular' },
]
}
});
NavigationView보기
Ext.define('sample.view.wares.lists.Popular', {
extend: 'Ext.NavigationView',
xtype: 'Popular',
config: {
iconCls: 'home',
title: 'Pop. prekės',
items: [
{
xtype: 'wares',
}
]
}
});
목록보기
Ext.define('sample.views.wares.lists.List', {
extend: 'Ext.List',
xtype: 'wares',
config: {
store: 'Wares',
itemTpl: '{Name}'
},
initialize: function() {
this.config.title = sample.app.title;
}
});
동적 아약스 재를 통해로드 된 기록의 저장소 개체 탐구.
Ext.define('sample.store.Wares', {
extend: 'Ext.data.Store',
config: {
model: "sample.models.WaresListItem"
}
});
같은 결과를 초기화 할 필요가 없을 것입니다 당신은 선언 블록
이 이동할 수 있으며이
같이 할 경우. 레이아웃 구성이 목록을 표시하는 데 영향을 미치지 않았습니다. –