PDA

View Full Version : 2 context menus at the same time?



nbinder
21 Jun 2007, 5:38 AM
Creating ContextMenus (yeah, that really know the context) is so easy... thank you guys.

But... why is it showing 2 context menus at the same time here? I went through your example more than twice, comparing every single part...

The standard browser context menu keeps showing up.

I once created my own context menus (without ext) long time ago and have something like "return false" in mind, but that does not change anything... my code to bring up the menu is the following:

grid.on('contextmenu', showCtxMenu, this);

function showCtxMenu(e){
CtxMenu.showAt(e.getXY());
// this line here does not help :(
return false;
}

I guess it's a simple mistake :">

evant
21 Jun 2007, 5:59 AM
grid.on('contextmenu', showCtxMenu, this);

function showCtxMenu(e){
CtxMenu.showAt(e.getXY());
// this line here does help
e.stopEvent();
}

Try that.

nbinder
21 Jun 2007, 6:45 AM
Yeah, that was exactly what i was looking for... but I don't understand how the example works without it... :-/

Thanks!

dantheman
6 Jul 2007, 2:43 PM
Using the docs (1.1b2) I had added the kitchen sink with no joy:
(this based on the example in the docs) (I added them one-by-one :D )


grid.on( 'cellcontextmenu', conMenu, this, {
stopEvent: true,
stopPropagation: true,
preventDefault: true
});


The example above of using e.stopEvent() in the handler itself works.

I'm just wondering why the listener configs are ignored?

--dan