Additional context menu handlers #15946
Labels
component: data grid
This is the name of the generic UI component, not the React module!
customization: logic
Logic customizability
enhancement
This is not a bug, nor a new feature
support: premium standard
Support request from a Premium standard plan user. https://mui.com/legal/technical-support-sla/
waiting for 👍
Waiting for upvotes
Summary
There is currently an
onColumnHeaderContextMenu
event to capture right clicking on the column header. It would be useful to extend these handlers to include anonRowContextMenu
andonCellContextMenu
. Whilst a similar outcome can be achieved using theonContextMenu
slot prop, extra work is required to extract useful properties such as the column definition.The solution involves exposing an
onRowContextMenu
andonCellContextMenu
prop directly from the grid to create a consistent API. Both handlers would follow the same interface as their left click counterparts:They would then be exposed from the grid like so:
Examples
#14734
Motivation
Listen for context menu events on grid cells with simplified access to cell properties (e.g.
colDef
,value
etc.).Search keywords: eventhandler contextmenu prop
Order ID: 45466
The text was updated successfully, but these errors were encountered: