Sort Manager
Implement and customize the Sort Manager component to enable flexible column sorting in LyteNyte Grid.
The Sort Manager is a headless React component available in LyteNyte Grid PRO. It manages the grid's sort configurations-allowing users to add, remove, or adjust sorts. The base component is unstyled, so you can fully match it to your application's look and feel. This is especially useful for multi-column sorting.
Basic Setup
Example usage:
import { SortManager as SM } from "@1771technologies/lytenyte-pro";// Inside a function component-call the hook and provide a grid instancefunction Sort() {const { rootProps, rows } = SM.useSortManager({ grid });return (<SM.Root {...rootProps}><SM.Rows>{rows.map((c) => {if (c.isCustom)return (<SM.Row><div>Custom Sort</div><SM.Add /><SM.Remove /></SM.Row>);return (<SM.Row row={c} key={c.index}><SM.ColumnSelect /><SM.ValueSelect /><SM.DirectionSelect /><SM.Add /><SM.Remove /></SM.Row>);})}</SM.Rows><SM.Clear>Clear</SM.Clear><SM.Cancel>Cancel</SM.Cancel><SM.Apply>Apply</SM.Apply></SM.Root>);}
When using the Sort Manager, only columns with the sortable UI hint appear in the column selection
list. Make sure to set sortable: true for columns you want to be available.
Sort Manager
Sort Manager Parts
Root- Provides the root context for the Sort Manager. All parts should be rendered insideRoot.Rows- Container for sort rows. Includes keyboard navigation but is otherwise a plaindiv.Row- Represents a single sort configuration. Has anisCustomflag for custom sorts (not configurable by Sort Manager but removable).ColumnSelect- Dropdown to choose the column for sorting. Can be replaced with a custom component using theasprop.ValueSelect- Dropdown to choose sort type (e.g., absolute sort for numbers). Can be replaced with a custom component via theasprop.DirectionSelect- Dropdown to choose sort direction. Can be replaced using theasprop.Clear- Button to remove all sorts.Cancel- Button to cancel changes made in the Sort Manager.Apply- Button to apply the current sort configuration to the grid.
Popover Frame
Learn how to implement and use dialog frames in LyteNyte Grid to create accessible modal interfaces in your grid applications.
Grid Box
The LyteNyte Grid PRO library includes a versatile list component called GridBox. This component can be used to create both horizontal and vertical lists that integrate seamlessly with LyteNyte Grid.