I am migrating a personal project from 3.6 to 4.1 (using Standard Edition). The following code works correctly in 3.6, returning a valid value for the grid to which the context menu is attached - in the format rowId_columnId:
Thanks Darya - the approach using the grid.contextID property works as long as I know which grid has been clicked on, which in most cases I do, because each grid has its own context menu.
However, I do have a case where the grid is created dynamically, and a standard context menu attached. In these cases, I do not know beforehand which grid is the source of the click, and would need to use the menu’s own context.
(I could create a workaround, allocating each grid a unique context menu when it is set up, but I’d like to avoid that if possible.)
Will the context menu zoneId always be false in v4.1 for a grid?
You can attach onBeforeContextMenu handler for all grids, and from this handler store reference to the current grid. This event will be called before opening context menu, so it is the best place to detect against which greed operation will be executed.