PDA

View Full Version : try to fire a 'contextmenu' event on the element of a field



flamant
12 May 2011, 12:13 PM
Hi,
I put a contextmenu event on the element of a field



var elt = field.getEl();
elt.on('contextmenu', function(evt, elRef) {
evt.stopEvent();
.....})


afterwards I would like to fire this event given the field in a keymap



function applyKeyMapToField(field) {
new Ext.KeyMap(field.getEl(),
{
key: 'a',
ctrl: true,
alt: true,
fn: function() {
The place where I want to fire the contextmenu event of the field
},
stopEvent: true
}

)
}


we can't use fireevent on "field.getEl()" or "field.getEl().dom" and field.fireEvent('contextmenu') doesn't work

Thank you in advance for your answers

friend
13 May 2011, 9:58 AM
A contextmenu event is usually generated by a right-click of the mouse. Are you saying that you want the Ctrl+A of your keymap to invoke the context menu on the target field?