2013-08-05 22 views
1

我对Sencha Touch2有疑问?为什么数据视图不显示?多谢如何在Sencha Touch2中显示数据视图?

这是模型文件,应用程序/模型/ Worklist.js

Ext.define('Geo.model.Worklist', { 
    extend: 'Ext.data.Model', 

    config: { 
     fields: [ 
      {name: 'name', type: 'string'}, 
      {name: 'url', type: 'string'} 
     ] 
    } 
}); 

这是存储文件, 应用/存储/ Worklist.js /** * 这是存储文件, *应用程序/商店/ 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'} 
     ] 
    } 
}); 

这是视图文件, 应用程序/视图/仪表板/ Show.js /** * 这是视图文件, *应用程序/视图/仪表板/ 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); 

我不知道为什么,当我点击列表项目之一,它无法显示,任何人都可以帮我吗?非常感谢

+0

可以共享的application.js完成这个

config:{ fullscreen: true, scrollable: 'vertical', store: 'Worklist', itemTpl: new Ext.XTemplate( '<tpl for=".">', '<div style="font-size:12px;">', '<img src="{url}" titel="{name}"><br />', '</div>', '</tpl>' ) } 

感谢什么样的? –

回答

1

我发现这个问题,我忘了Geo.view config属性.dashboard.S如何

这应该是很多

相关问题