PDA

View Full Version : Button rightclick



frankbolviken
12 Sep 2011, 3:08 AM
Hi,

Been trying a few different "sollutions", but I havent been able to find how to add a contextmenu on rightclick on buttons for extjs 4.0

Anyone got a sollution for this?

Frank

tobiu
12 Sep 2011, 4:09 AM
not sure if this is the best way, but it does the trick.



var testButton = new Ext.Button({
text : "test",
listeners : {
afterrender : function(button) {
button.el.on('contextmenu', function(e) {
console.log('contextmenu');
e.stopEvent();
})
}
}
});

frankbolviken
12 Sep 2011, 4:46 AM
Thanks for this! how do I mark as solved?:P