Context Menu
Implement customized context menus to enable interactive functionality for specific grid elements in LyteNyte Grid.
LyteNyte Grid provides the grid.api.positionFromElement
method to help implement context menu
functionality. The context menu component itself must come from your preferred UI library.
The example below demonstrates integration with the Radix UI Context Menu.
Context Menu
Integration
In the example, grid rows are wrapped in Radix UI's ContextMenu.Root
. This illustrates one of the
advantages of a headless grid: you can integrate third-party UI components easily and decide where
and how to attach them.
Position Resolution
The grid.api.positionFromElement
method returns either a PositionUnion
object or null
.
A PositionUnion
represents the resolved grid position of an element and can identify:
- Cell
- Floating cell
- Header cell
- Full-width row
- Header group cell
The element you pass does not have to be the direct grid element-it can be a child element. LyteNyte Grid resolves it to the correct grid position automatically.
Filter Tree
The Filter Tree component lets you update filters using a tree-based UI. It is especially useful for columns with a limited set of values. A filter tree can be flat or hierarchical-the example below shows both.
Dialog Frame
Implement and use dialog frames in LyteNyte Grid to create accessible modal interfaces in your grid applications.