PDA

View Full Version : Context menu still shows



lufton
11 Jun 2013, 6:19 AM
I want to show custom context menu in my gridpanel. On itemcontextmenu listener function I do:

e.preventDefault();
e.stopEvent();

But browser default context menu sometimes shows (ExtJS 4.2.0-4.2.1). I tested in Chrome 27. In FF it works as expected.
JSFiddle example (http://jsfiddle.net/lufton/F9G9m/).

http://www.youtube.com/watch?v=q9UkjzG3WrY

slemmon
11 Jun 2013, 12:06 PM
I tried to reproduce the issue you're seeing on Chrome 27 on Win7 and Win8 with 4.2 through JSFiddle and also on 4.2.1 by just pulling the code into my own project and I never could reproduce the issue you're seeing / demonstrating in the video.

On both of my boxes I had recently uninstalled Chrome and reinstalled due to another issue only observable in Chrome. I wonder if the fresh install is the difference? Just guessing since I wasn't able to reproduce the issue.

lufton
11 Jun 2013, 2:29 PM
Maybe it is because I have some extra context menu items added by chrome extensions? I open new Incognito window of chrome (to disable all extensions) but here I get original menu. I tried on Windows XP laptop - original menu didn't shows. So the problem is on my PC. I'll try to reinstall chrome as soon as I can and inform you. Thanks!

chamacs
11 Jun 2013, 3:22 PM
Are you sure you right-clicked over a selectable row? The itemcontextmenu event only triggers on selectable rows. It you want to suppress the browsers context menu in the 'white space' of the grid, use the containercontextmenu event.

lufton
11 Jun 2013, 11:13 PM
Yes I am sure I right click on the row! I added containercontextmenu listener with preventing of context menu opening: now context menu still showing on right click over row and don't showing on right click over container.

chamacs
12 Jun 2013, 9:11 AM
Using your JSFiddle code directly, the only way I can get the browser context menu to show up is if I right-click twice in the same spot. The normal context menu shows up on the first click, but the second right-click is no longer on the row so the itemcontextmenu event won't be triggered. I don't know if there is a solution for too many right-clicks in the same location.

felix822
5 Jun 2014, 6:31 AM
Sorry, I know this thread is old, but just wondering if you found a solution.

I'm having the same problem with context menus in Chrome and Safari.