PDA

View Full Version : Right-click in Chart and/or Panel



Thomas Triplet
4 Oct 2012, 5:15 AM
Hello,
I dont see any event for right-clicks for classes Ext.panel.Panel and Ext.chart.Chart, like something equivalent to the containercontextmenu or itemcontextmenu events for grid panels. Am I missing something and how can I get around this in a clean manner?
Thanks a lot for your input!

Elfayer
4 Oct 2012, 6:01 AM
To add an event to a component:


(Ext.ComponentQuery.query('#ComponentId')[0]).getEl().on('contextmenu', function (e, t, eOpts) {
// What you want to do
});

see : http://docs.sencha.com/ext-js/4-1/#!/api/Ext.dom.Element-event-contextmenu

Thomas Triplet
4 Oct 2012, 6:08 AM
That does the job :) Thanks Elfayer!

Still a bit weird that the Chart component support the click and dblclick events, but not the right-click...