OGE logoOGE

Context Menus

Two event-driven menus: right-click a row to open your own actions, right-click a header to get the built-in sort / group / pin / hide items — which you can extend, filter or replace per column. Both use the same lightweight OgeMenuItem shape; no menu component to import.

rowContextMenu headerContextMenu OgeMenuItem
rowContextMenu
Right-click any row.
First Name
Last Name
Department
Ayşe
Yılmaz
Finance
Zeynep
Demir
Engineering
Can
Arslan
Finance
Zeynep
Çelik
Finance
Selin
Şahin
Engineering
Deniz
Demir
Support
30 rows

Header menu customization

The header menu works out of the box (right-click any header). With headerContextMenu you receive the prebuilt items and mutate the array: below, every column gains a custom Say hello item, and the Salary column loses its pin entries.

headerContextMenu built-ins + custom
Right-click a column header — try Salary, its pin items are removed.
Drag a column header here to group
No commands to display
First Name
Department
Salary
Ayşe
Finance
79000
Zeynep
Engineering
96000
Can
Finance
66000
Zeynep
Finance
34000
Selin
Engineering
47000
Deniz
Support
62000
30 rows

API

MemberDescription
(rowContextMenu)OgeContextMenuEvent<T>: row, key, clientX/Y, mutable items. Empty items → native browser menu.
(headerContextMenu)OgeHeaderContextMenuEvent: field, caption, clientX/Y, mutable items prefilled with the built-ins.
OgeMenuItem{ text, action?, disabled? } — the menu closes automatically after an action runs.

Notes

  • Menus close on outside click, on Escape, and after running an item.
  • Header built-ins adapt to the column: sort items only for sortable columns, group items only with a group panel, pin items reflect the current pin state.
  • All built-in texts are localizable through provideOgeGridConfig messages.