Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/cmake/2.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喷漆事件未点火_Sencha Touch 2 - Fatal编程技术网

Sencha touch 2 Sencha Touch 2喷漆事件未点火

Sencha touch 2 Sencha Touch 2喷漆事件未点火,sencha-touch-2,Sencha Touch 2,我构建了一个视图,我想在绘制视图之后对元素进行一些操作 我试图使用绘画活动,但没有效果 你知道为什么吗 Ext.define('TestApp.view.phone.RegisterViewPhone', { extend: 'Ext.Panel', xtype: 'RegisterViewPhone', config: { items: [ { xtype: 'Header'

我构建了一个视图,我想在绘制视图之后对元素进行一些操作

我试图使用绘画活动,但没有效果

你知道为什么吗

Ext.define('TestApp.view.phone.RegisterViewPhone', {

    extend: 'Ext.Panel',

    xtype: 'RegisterViewPhone',

    config: {

        items: [
            {
                xtype: 'Header'
            },{
                xtype: 'panel',
                itemId: 'thePanel',
                html: 'THIS WILL HOLD THE VIEWS CONTENT'
            },{
                xtype: 'Footer'
            }
        ],

        listeners: [
            {
                delegate: '#thePanel',
                event: 'painted',
                fn: 'onPainted'
            }
        ]
    },
    onPainted: function () {
        alert('hey!');
    }
});

您可以将侦听器附加到该特定元素,如

   {
        xtype: 'panel',
        itemId: 'thePanel',
        html: 'THIS WILL HOLD THE VIEWS CONTENT',
        listeners: {
            painted: function(){
                alert('hey!');
            }
        }
    }
因为绘制不依赖于单个元素,并且它作用于页面范围,所以您可以直接在视图中编写它

items: [
 ],
 listeners: {
 painted: function () {  
   alert('hey!');
 }