PDA

View Full Version : add event 'mousedown' handler to Ext.menu.Item



mxu
6 Mar 2008, 10:54 PM
how to add event 'mousedown' handler to Ext.menu.Item
and
get the html Id of li element representing Ext.menu.Item

Condor
6 Mar 2008, 11:29 PM
Use:


var item = new Ext.menu.Item({
...
listeners: {
render: function(c) {
c.el.on('mousedown', function(el) {
// do stuff (this == LI, el = A)
}, c.container);
}
}
});

mxu
7 Mar 2008, 10:32 PM
works fine on IE but not working on FF,
'mousedown' event handler, c.el.on('mousedown', function(el) stopped Ext.menu.Item's 'click'
event handler in FF

mxu
9 Mar 2008, 9:26 PM
works fine on IE but not working on FF,
'mousedown' event handler, c.el.on('mousedown', function(el) stopped Ext.menu.Item's 'click'
event handler in FF

listeners : {
'click': function(menuItem, e){
...
}
,render: function(c) {
c.el.on('mousedown', function(el) {
...
}
}
}