PDA

View Full Version : ExtJS 4.1 MVC detect splitbutton's menu's 'click' event



panbayi
13 Jan 2013, 10:42 PM
How can I detect the 'click' event of a splitbutton's menu in a controller?
For example,I have splitbutton

{
xtype : 'splitbutton',
icon-Cls: 'mycls',
text: 'mysplitbutton',
menu : {
items : [
{text : 'button A',action : 'A'},
{text : 'button B',action : 'B'}
]
}
}
I cannot detect the button A or button B in controller like this

....some code....
init : function(){
this.control({
'button[action=A]' : {
click : this.myFucntionToButtonA
}
});
}

panbayi
13 Jan 2013, 11:53 PM
Eh....,it's solves.I should have added 'xtype : "button" 'in each item property.