我对 Sencha Touch2 有疑问?为什么 dataView 不显示?非常感谢
这是模型文件,app/model/Worklist.js
Ext.define('Geo.model.Worklist', {
extend: 'Ext.data.Model',
config: {
fields: [
{name: 'name', type: 'string'},
{name: 'url', type: 'string'}
]
}
});
这是商店文件,app/store/Worklist.js /** * 这是商店文件,* app/store/Worklist.js */
Ext.define('Geo.store.Worklist',{
extend: 'Ext.data.Store',
config: {
model: 'Geo.model.Worklist',
autoLoad: true,
data:[
{name:'book1',url:'images/html51.jpg'},
{name:'book2',url:'images/html52.jpg'},
{name:'book3',url:'images/html53.jpg'},
{name:'book4',url:'images/html54.jpg'},
{name:'book5',url:'images/html55.jpg'}
]
}
});
这是视图文件,app/view/dashboard/Show.js /** * 这是视图文件,* app/view/dashboard/Show.js */
Ext.define('Geo.view.dashboard.Show', {
extend: 'Ext.DataView',
xtype: 'dashboard-show',
//fullscreen: true,
scrollable: 'vertical',
store: 'Worklist',
itemTpl: new Ext.XTemplate(
'<tpl for=".">',
'<div style="font-size:12px;">',
'<img src="{url}" titel="{name}"><br />',
'{name}',
'</div>',
'</tpl>'
)
});
/** * 主控制器文件,Application.js */
config: {
refs: {
main: 'mainview',
editButton: '#editButton',
dashboards: 'dashboards',
showDashboard: 'dashboard-show',
editDashboard: 'dashboard-edit',
saveButton: '#saveButton'
}
}
var workStore = Ext.create('Geo.store.Worklist');
this.showDashboard = Ext.create('Geo.view.dashboard.Show');
this.showDashboard.setStore(workStore);
this.getMain().push(this.showDashboard);
我不知道为什么当我点击列表项之一时它无法显示,任何人都可以帮助我吗?非常感谢