PDA

View Full Version : button containercontextmenu



ttbgwt
23 May 2012, 12:18 PM
I'm trying to detect when a button is right-clicked but can't find a containercontextmenu event in the docs? Any suggestions on how to do this?

vietits
23 May 2012, 5:16 PM
Try this:


Ext.onReady(function(){
Ext.create('Ext.button.Button', {
text: 'Right-click me',
renderTo: Ext.getBody(),
listeners: {
contextmenu: {
element: 'el',
fn: function(e){
e.stopEvent();
console.log('button right-clicked')
}
}
}
});
});