处理菜单检查项目事件的正确方法是什么?
我有这个菜单:
{
xtype: 'button',
id: 'types_btn',
autoWidth: true,
text: 'Types',
menu: {
xtype: 'menu',
frame: true,
id: 'types_menue',
items: [
{
xtype: 'menucheckitem',
id: 'f_type',
text: 'first',
listeners: {
checkchange: {
fn: me.onFirstButtoncheckchange,
scope: me
}
}
},
{
xtype: 'menucheckitem',
id: 's_type',
text: 'second',
listeners: {
checkchange: {
fn: me.onSecondButtoncheckchange,
scope: me
}
}
}
然后是函数:
onFirstButtoncheckchange: function(menucheckitem, checked, options) {
var t = Ext.getCmp('f_type');
if (t.checked)
goToFunction(???);
.
.
},
onSecondButtoncheckchange: function(menucheckitem, checked, options) {
var t = Ext.getCmp('s_type');
if (t.checked)
goToFunction(???);
.
.
},
1-无论如何使用一个侦听器并在其中收集所有不同的功能?
2- 如您在代码中所见,如何将当前项目发送到 goToFunction()?