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