View Full Version : GridPanel contextmenu event issue

12 Jul 2009, 7:16 AM
A requirement of mine is to provide a different context menu configuration based on if the user clicks on either the header, a row, or any white space in the grid. However, this is proving quite challenging with the current event model of the GridPanel. The problem is that the contextmenu event always fires and it fires first. The problem this creates is that there is really no reliable way to determine if the user right clicked on a row or white space because the rowcontextmenu fires after contextmenu. If the rowcontextmenu fired before the contextmenu, I could set a flag and prevent the contextmenu code from running. But because contextmenu runs first, that code always executes, thus displaying the wrong menu even if the user was on top of a row. I think it would make more sense if the more specific events were fired first in order, and the "raw" event fired after every other event, such as:


That way, the first event in the chain would have priority. Or, provide a separate event for whitespacecontextmenu.

Anyone else agree with this?