Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 2 Sencha touch 2-如何使Ext.Img的src动态_Sencha Touch 2 - Fatal编程技术网

Sencha touch 2 Sencha touch 2-如何使Ext.Img的src动态

Sencha touch 2 Sencha touch 2-如何使Ext.Img的src动态,sencha-touch-2,Sencha Touch 2,如何使Ext.Img的src动态 Ext.define('App.view.Welcomescreen', { extend: 'Ext.Carousel', xtype: 'welcomescreen', config: { items: [ { xtype: 'image', src: 'http://src.sencha.io/screen.wid

如何使Ext.Img的src动态

Ext.define('App.view.Welcomescreen', {

    extend: 'Ext.Carousel',
    xtype: 'welcomescreen',

    config: {      
        items: [
            {
                xtype: 'image',
                src: 'http://src.sencha.io/screen.width/http://www.google.co.in/images/srpr/logo3w.png',
            },
            {
                xtype: 'image',
                src: 'http://src.sencha.io/screen.width/http://www.google.co.in/images/srpr/logo3w.png',
            },
            {
                xtype: 'image',
                src: 'http://src.sencha.io/screen.width/http://www.google.co.in/images/srpr/logo3w.png',
            }
        ]
    }
});

我想使用store为“src”赋值

也许最简单的解决方案是与

config:{
itemTpl=“”,
内联:对
}

如果绑定到某个存储,它将根据需要刷新自身,不幸的是,如果不进行其他修改,您将丢失转盘效果。

谢谢David,但我想使用转盘。如果您卡在转盘上,则需要将存储绑定到视图,将该存储的刷新事件的侦听器添加到视图中,并使用某种模板机制获取存储中的每条记录以生成Ext.Img的src。从那时起,可以通过重建所有子项或将更新的数据与现有元素进行区分来处理后续刷新。
config: {
 itemTpl = "<img src={source}>",
 inline: true
}