The parameters the columnAutosize
method accepts.
A list of columns to autosize. If omitted, all columns are included in the operation.
No properties
If true
, performs the autosize calculation without applying the changes. Returns the calculated widths.
boolean
If true
, includes the column header when calculating the autosize width.
boolean
The parameters that may be provided to the columnMove
API method.
If the move columns should be placed before the target column.
boolean
The columns being moved. May be the column id or the column itself. All the columns should be present in the grid's column definitions.
No properties
The move target for the columns. The target may not be present in the move columns, i.e. can not move a column to itself.
string | number | Column
string
number
Column
(docs)If the pin state of the columns being moved should be updated to match the target column.
boolean
The accepted input types for the focusCell
method, which updates the active focus in LyteNyte Grid.
Supports various formats:
{ column: string | number | Column; row: number } | PositionHeaderCell | Omit | "next" | "prev" | "up" | "down"
{ column: string | number | Column; row: number }
PositionHeaderCell
(docs)Omit
"next"
"prev"
"up"
"down"
The LyteNyte Grid API provides a comprehensive set of methods that allow developers to programmatically query, update, and manipulate grid state and data.
Automatically adjusts the widths of columns based on their content. Accepts optional parameters to control the behavior.
params | ColumnAutosizeParams (docs) |
Record
Returns the column with the specified id. If no matching column is found, returns undefined
.
id | string |
undefined | Column
Returns the column at the specified visible index. If the index is out of bounds or the column is hidden (due to visibility rules or collapsed groups), this will return null.
columnIndex | number |
null | Column
Retrieves the calculated value for a specific column and row. Useful in cases where the column's field is not a direct path, or when additional logic is involved in determining cell values. It provides access to LyteNyte Grid's internal field evaluation pipeline.
columnOrId | string | Column |
row | FieldDataParam (docs) |
unknown
Returns the index of a visible column based on its id or column object. Returns -1 if the column is not currently visible (e.g., hidden or inside a collapsed group).
columnOrId | string | Column |
number
Moves one or more columns before or after a specified target column. This operation respects column group visibility and layout rules.
params | ColumnMoveParams (docs) |
void
Resizes one or more columns by providing an object where each key is a column id and the value is the new width in pixels.
columns | Record |
void
Toggles the expansion state of one or more column groups. You can also pass a boolean to directly set the expansion state.
group | string | string[] |
state | boolean |
void
Applies updates to one or more columns. Each key in the object is a column id, and each value is the set of updates to apply.
updates | Record |
void
Closes dialog frames. If an id is provided, only the dialog with that id is closed; otherwise, all open dialogs will be closed.
id | string |
void
Opens a dialog frame by its id. You may optionally provide a context object that will be passed into the dialog's renderer for dynamic configuration.
id | string |
context | any |
void
Starts cell editing at a specified location. If the grid is set to read-only mode, this method has no effect.
params | EditBeginParams (docs) |
void
Ends the currently active cell edit. If there is no active edit session, the method does nothing.
Can optionally cancel the edit if true
is passed.
cancel | boolean |
void
Returns true
if the provided cell is currently being edited. Useful for conditionally rendering custom cell UI.
params | EditBeginParams (docs) |
boolean
Applies an edit to the specified cell programmatically. This directly updates the data without going through the UI.
params | EditUpdateParams (docs) |
void
Adds an event listener to the grid for a specified event. Returns a function that can be called to remove the listener.
event | K |
fn | (event: ) => void |
() => void
Manually dispatches a grid event with a given payload. This is intended for advanced usage where custom behavior or testing scenarios require simulating native event lifecycles.
name | K |
event | `` |
void
Removes a registered event listener. The exact event and handler function must be provided.
event | K |
fn | (event: ) => void |
void
Exports the cell data for a given rectangle of the grid as a CSV-formatted string. The rectangle can be customized through parameters such as selected rows, columns, or cell ranges.
params | ExportCsvParams (docs) |
Promise
Generates a downloadable CSV Blob
from the selected rectangular area of grid cell data.
Can be used to trigger a file download in the browser.
params | ExportCsvParams (docs) |
Promise
Returns the raw cell data within a rectangular selection of the grid. This can be useful for custom data processing or exporting workflows.
params | ExportDataRectParams (docs) |
Promise
Sets focus to a specific cell or navigates the focus based on a direction keyword. Useful for keyboard-driven navigation and programmatic focus management.
position | FocusCellParams (docs) |
void
Closes popover frames. If an id is provided, only the corresponding frame is closed; otherwise, all popover frames will be dismissed.
id | string |
void
Opens a popover frame at the specified target element or virtual target. An optional context can be passed into the popover renderer for configuration.
id | string |
target | HTMLElement | VirtualTarget |
context | any |
void
Returns the grid-relative position of the specified HTML element. This can help determine if an element belongs to a specific grid cell, header, or other region—useful for anchoring popovers or tooltips.
el | HTMLElement |
null | PositionUnion
Retrieves a row by its unique id. Returns null
or undefined
if the row doesn't exist or
is not currently available in the data source.
id | string |
undefined | null | RowNode
Retrieves a row based on its index and optional section (body, pinned top, or pinned bottom).
Returns null
or undefined
if the index is out of range.
index | number |
section | RowSection (docs) |
undefined | null | RowNode
Checks whether the detail panel for the given row is currently expanded. Returns true
if expanded.
rowOrId | string | RowNode |
boolean
Returns the rendered height of the row's detail section only. Does not include the standard row height.
rowOrId | string | RowNode |
number
Toggles the detail expansion for the specified row. Optionally provide a boolean to explicitly set the expansion state.
rowOrId | string | RowNode |
state | boolean |
void
Applies multiple group row expansion states using a mapping of row ids to expansion booleans. Useful when restoring or syncing expansion state.
expansions | Record |
void
Returns the group index associated with a group column. Useful in header or cell renderers dealing with auto-generated group columns in the grid.
c | Column (docs) |
number
Returns a boolean indicating if the specified group row is currently expanded.
row | RowGroup (docs) |
boolean
Toggles the expansion state of a group row. Optionally accepts a boolean state to set expansion explicitly. This method triggers the row group expansion lifecycle.
row | RowGroup (docs) |
state | boolean |
void
A method that may be used in DOM event handlers to trigger row selection logic. Ideal for integrating checkbox-based or custom selection workflows. Also supports bulk row selection.
params | RowHandleSelectParams (docs) |
void
Type guard that checks if a row node is a group. Helps distinguish between leaf and group rows.
row | RowNode (docs) |
``
Type guard that determines whether a row node is a leaf node (i.e., not a group). Useful when working with union row types such as RowLeaf and RowGroup.
row | RowNode (docs) |
``
Selects a specific set of rows based on the provided RowSelectOptions . Triggers corresponding selection-related grid events.
params | RowSelectOptions (docs) |
void
Selects all rows in the current grid view. Accepts RowSelectAllOptions for fine-grained control. Triggers selection-related events.
params | RowSelectAllOptions (docs) |
void
Returns the list of currently selected row nodes. Note that some returned rows may not be part of the visible grid, depending on the data state.
This function takes no parameters.
RowNode[]
(docs)
Ensures the specified row and/or column is scrolled into view. Accepts a configuration object that controls the scroll behavior.
options | ScrollIntoViewOptions (docs) |
void
Retrieves the current sort object and its index from the sort model for a given column. If no sort applies to the column, returns null.
columnOrId | string |
null | { index: number; sort: SortModelItem }
A React hook that returns props and state for row dragging support. These props can be attached to a drag handle in your component to initiate drag behavior. This must follow React’s hook rules.
params | UseRowDragParams (docs) |
{ dragProps: any; isDragging: boolean }
The parameters used for the rowHandleSelect
API method of LyteNyte Grid.
Indicates whether the shift key is pressed. Required for enabling range-based (bulk) row selections.
boolean
The event target to handle.
Type | EventTarget |
Options for the scrollIntoView
API. Allows you to scroll a specific row and/or column into view,
ensuring they are visible in the viewport.
Defines the scrolling behavior. "smooth" animates the scroll, "auto" uses browser default behavior, and "instant" jumps immediately.
"auto" | "smooth" | "instant"
"auto"
"smooth"
"instant"
The column index, column id, or column object to bring into view. Triggers a horizontal scroll if the column is not currently visible.
string | number | Column
string
number
Column
(docs)The index of the row to bring into view. Triggers a vertical scroll if the row is not currently visible.
number