有人能告诉我为什么“getEl()”方法在我的代码中不起作用吗?
通知容器:
Ext.define('common.NotificationContainer', {
extend: 'Ext.container.Container',
alias: 'widget.NotificationContainer',
border: true,
layout: {
type:'fit'
},
style: {
zIndex: '999999'
},
defaultType: 'container',
items: [{
cls: 'notification-box',
border: true,
width: 500,
items:[{
html: ''
},{
layout: {
type: 'vbox',
align: 'center'
},
items: [{
xtype: 'button',
text: 'OK',
minWidth: 75,
margin: '10 0 0 0',
handler: function() {
this.up().up().up().getEl().slideOut('t', { duration: 1000 });
}
}]
}]
}]
});
功能:
var con_notification = Ext.create('common.NotificationContainer');
var con_notification_box = con_notification.child();
con_notification_box.addCls(cls);
if (server_response == undefined) {
con_notification_box.items.items[0].update('<p><span class="custom-msg">' + custom_msg + '</span></p>');
} else {
con_notification_box.items.items[0].update('<p><span class="custom-msg"> ' + custom_msg + '</span><br /><br /><span class="server-response">Server Response:</span>' + server_response + '</p>')
}
con_notification.add(con_notification_box);
con_notification.getEl().slideIn('t', {
easing: 'easeOut',
duration: 1000
});
非常感谢您的支持!
亲切的问候,嘘