2
處理菜單檢查項目事件的正確方法是什麼?Extjs 4.1 Check Change Listener
我有這樣的菜單:
{
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(),如代碼中所示?
謝謝威爾克.. – Noon
ü歡迎;) – Wilk