columnContextMenuItem
columnContextMenuItem<
TData,TArgs>(id,factory):ColumnContextMenuItemFactory<TData,TArgs>
Defined in: contextMenu.tsx:172
Helper function to create a column context menu item with full context access.
The factory function receives context including the clicked column header, table instance, and plugin configuration args.
Type Parameters
Section titled “Type Parameters”TData
TArgs = unknown
Parameters
Section titled “Parameters”string
Unique identifier for the menu item
factory
Section titled “factory”(ctx) => ContextMenuItemEntry
Factory function that receives context and returns menu item entry
Returns
Section titled “Returns”ColumnContextMenuItemFactory<TData, TArgs>
Examples
Section titled “Examples”columnContextMenuItem("hide-column", (ctx) => ({ label: "Hide column", onClick: () => { ctx.column.toggleVisibility(false); },}))columnContextMenuItem("sort-asc", (ctx) => ({ label: "Sort ascending", onClick: () => { ctx.column.toggleSorting(false); }, visible: ctx.column.getCanSort(),}))