Ticket #6810 (closed enhancement: worksforme)
Please provide a mechanism to allow a dijit.Menu context menu to be opened only over actual data rows
| Reported by: | guest | Owned by: | sorvell |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | DojoX Grid | Version: | 1.1.0 |
| Severity: | normal | Keywords: | |
| Cc: | yatessc@… |
Description
dijit.Menu context menus are designed to be bound to specific DOM nodes either in the declaration, or via the Menu's bindDomNode() method. There does not appear to be a <div> or other DOM node with a fixed id in Grid which represents only the actual data rows, and excludes the scrollbars and any blank area below the rows if the data is not enough to fill the Grid's display area. This means that you end up displaying a context menu that is only valid if a specific row was clicked in those other locations as well, and there is no way within Menu to change its contents based on the event's contents/location before it is already open.
Obviously various workarounds are available - I have adopted one where I call the Menu's _openMyself() method directly from the Grid's onRowContextMenu handler, rather than binding it, but this has the disadvantages that it is calling an internal method, and that it breaks the Menu's keyboard accessibility features. It would also be possible to build a custom dijit based on Menu, but this seems excessive for what should be a simple task.