【发布时间】:2020-11-18 15:09:03
【问题描述】:
在我的界面中我创建了这个按钮:
{
xtype: 'button',
width: 196,
height: 29,
hidden: false,
text: Strings.sharedNotifications,
glyph: 'xf003@FontAwesome',
handler: 'onNotificationsClick',
reference: 'settingsNotificationsButton',
cls: 'buttonsCls',
id : 'settingsMenuButton7'
}
在控制器中,我将此函数定义为上述按钮的处理程序:
onNotificationsClick: function () {
Ext.create('Mine.view.BaseWindow', {
title: Strings.sharedNotifications,
items: {
xtype: 'notificationsView'
}
}).show();
},
我想在面板上应用一个额外的样式(添加一个带有addCls 方法的 CSS 类),它会根据控制器中定义的一些全局变量在点击时显示。如何将变量(比如var dark;)传递给onNotificationsClick,以便在单击时设置面板样式。
谢谢
【问题讨论】: