Sencha touch 2.4.1을 사용하여 상점에 정적 데이터로 목록을 채우려고합니다.Sencha 2.4.1 - 목록이 표시되지 않음
하나의 기본보기에는 제목 표시 줄과 목록이 있습니다. 이 목록은 저장소 기반 모델 인 Employee에서 데이터를 가져 오려고합니다.
다음 코드 스 니펫은 어디에 잘못 표시되는지 알 수 없습니다.
직원 목록보기Ext.define('MyApp.view.EmpList',{
extend: 'Ext.List',
xtype: 'emp_list',
config:{
itemTpl: Ext.XTemplate('<span>{firstname}</span>')
}
});
직원 스토어
Ext.define('MyApp.store.Employee',{
extend: 'Ext.data.Store',
config:{
storeId: 'emp_store',
model: 'MyApp.model.Employee',
emptyText: 'No Employees Yet!',
data:[
{firstname:'Danish', lastname:'Siddiqui', ranking:'1', is_manager:false},
{firstname:'Danish', lastname:'Siddiqui1', ranking:'2', is_manager:false},
{firstname:'Danish', lastname:'Siddiqui2', ranking:'3', is_manager:false},
{firstname:'Danish', lastname:'Siddiqui3', ranking:'4', is_manager:false},
]
}
});
직원 모델
Ext.define('MyApp.model.Employee',{
extend: 'Ext.data.Model',
config: {
fields:[
{name: 'firstname', type:'string'},
{name: 'lastname', type:'string'},
{name: 'ranking', type:'number'},
{name: 'is_manager', type:'boolean', defaultValue: false}
]
}
}); 직원 저장소에
홈페이지보기
Ext.define('MyApp.view.Main', {
extend: 'Ext.Container',
xtype: 'main',
requires:[
'Ext.TitleBar'
],
config: {
items: [
{
xtype: 'titlebar',
title: 'Employe Information',
items:[
{
xtype: 'button',
ui: 'back',
text: 'back'
}
]
},
{
xtype: 'emp_list',
store: 'emp_store'
}
]
}
});
콘솔에서 Ext.getStore ('Employee')가 정의되지 않은 상태에서 여전히 작동하지 않습니다. – mdanishs