Locked (frozen or sticky) columns are the columns that are visible at all times while the user scrolls the Grid horizontally.
By default, the columns of the Grid are not locked. The locked columns require all columns to have a fixed width.
The columnMenu can be used to render buttons that will lock and unlock a specific column on click.
In the following example we:
- Render a custom component inside the column menu that will lock and unlock the column.
- Update the columns collection when a column is locked/unlocked.
- Sort them by the
lockedfield to show all locked columns on the left.
When using the locked columns with a custom cell the specific styles and classes have to be added to the
td elements. The classes and the styles will be part of the cell props.