如何在Sencha Touch2中显示数据视图?

用户名

我有一个关于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);

我不知道为什么我点击列表项之一时无法显示,有人可以帮我吗?非常感谢

用户名

我找到问题了,我忘记了Geo.view.dashboard.Show中的config属性

应该是这样的

 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>'
    )
}

多谢

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在地图(sencha touch2)中手动设置当前位置?

在sencha touch2开发的移动应用程序上不显示列表视图

如何在sencha touch中显示列表项边框

如何在2个视图之间的sencha中发送数据

如何在Sencha Touch中使用已定义的视图

如何在Sencha Touch 2.2视图中显示容器和列表,并使整个视图可滚动?

如何在Sencha Touch中使用数据库?

Sencha Touch:如何在setData()之后刷新组件的数据?

如何在Sencha Touch中从数组设置选择字段?

如何在Sencha Touch中定义日期类型?

如何在Sencha Touch代码中获得Cordova插件的引用

如何在Sencha Touch中获取圆形markerimage谷歌地图

如何在sencha touch或Architect中获取设备语言

如何在sencha touch中获取列表模板项的值?

如何在 sencha 的文本字段中显示前导零?

如何在sencha touch轮播上添加固定按钮

如何在sencha touch中保存无线电场的状态

如何在Sencha Touch 2中区分列表的itemtap和itemtaphold事件

如何在sencha图表中将系列数据呈现为标题

如何在Sencha Fiddle中测试Crud Ajax请求

如何在Sencha中设置饼图的边框

如何在Sencha Touch中的vbox布局中设置按钮之间的间距

如何在详细查看sencha touch中更改“后退”按钮中的文本?

如何在sencha touch中的文本字段中添加图像

如何在选项卡面板内添加轮播-Sencha Touch 2

如何在sencha touch cordova应用程序中更改启动画面

如何在sencha touch中为文本字段执行字母数字验证

如何在 Sencha Touch 中为文本字段添加属性?

如何在sencha touch中通过其属性myId引用itemTpl