CM01 Right-Click Menu
Custom context menu with icons, keyboard shortcuts, and dividers
Live Demo
Right-click any cell or use keyboard shortcuts.
Code
Configuration
Menu Item Properties
id - Unique identifier
label - Display text (string or callback)
icon - Icon (string or callback)
shortcut - Keyboard shortcut (e.g., "C", "Delete")
danger - Red styling
dividerBefore - Add separator
disabled - Boolean or callback
visible - Boolean or callback
CM02 Dynamic Menu Items
Dynamic labels, icons, disabled state, and visibility based on row data
Context Object
The onclick callback receives a context object with:
row- The row data objectrowIndex- Index of the rowcolIndex- Index of the columncolumn- Column definitioncellValue- Value of the clicked cell
Code
Dynamic Properties
Callback Properties
These accept callbacks for dynamic behavior:
label: (ctx) => stringicon: (ctx) => stringdisabled: (ctx) => booleanvisible: (ctx) => boolean
CM03 Cell-Aware Actions
Show different menu items based on clicked column and cell value
Live Demo
Right-click different columns to see different menu items.
Code
Context Properties
Context Object
ctx.column.field - Column field name
ctx.cellValue - Cell's current value
ctx.colIndex - Column index
ctx.row - Full row data
ctx.rowIndex - Row index
Use Cases
- Email actions only on email column
- Status toggles only on status column
- Disable "Clear" for required fields
- Dynamic labels with cell values
CM04 Menu Positioning
Adjust horizontal and vertical offset of the context menu from click position
Live Demo
Right-click any cell to see the menu position.
Code
Configuration
Offset Properties
contextMenuXOffset - Horizontal distance from click (default: 0)
contextMenuYOffset - Vertical distance from click (default: 4)
Values
- Positive X = menu appears right of cursor
- Negative X = menu appears left of cursor
- Positive Y = menu appears below cursor
- Negative Y = menu appears above cursor
Edge Handling
The menu automatically flips or shifts to stay within viewport bounds.