@serenity-is/sleekgrid / GridOptions
Interface: GridOptions<TItem>
Configuration options for the SleekGrid component.
Type Parameters
• TItem = any
The type of items in the grid.
Properties
addNewRowCssClass?
optionaladdNewRowCssClass:string
CSS class applied to newly added rows for custom styling. Default is "new-row".
Defined in
alwaysAllowHorizontalScroll?
optionalalwaysAllowHorizontalScroll:boolean
Defaults to false. If true, a horizontal scrollbar is always visible regardless of content width.
Defined in
alwaysShowVerticalScroll?
optionalalwaysShowVerticalScroll:boolean
Defaults to false. If true, a vertical scrollbar is always visible, useful for fixed-height grids or menus.
Defined in
asyncEditorLoadDelay?
optionalasyncEditorLoadDelay:number
Defaults to 100. Delay in milliseconds before asynchronous loading of editors.
Defined in
asyncEditorLoading?
optionalasyncEditorLoading:boolean
Defaults to false. If true, editors are loaded asynchronously, reducing initial rendering load.
Defined in
asyncPostCleanupDelay?
optionalasyncPostCleanupDelay:number
Defaults to 40. Delay in milliseconds before cleaning up post-rendered elements.
Defined in
asyncPostRenderDelay?
optionalasyncPostRenderDelay:number
Defaults to -1 which means immediate execution. Delay in milliseconds before starting asynchronous post-rendering.
Defined in
autoEdit?
optionalautoEdit:boolean
Defaults to true. If true, automatically opens the cell editor when a cell gains focus.
Defined in
autoHeight?
optionalautoHeight:boolean
Defaults to false. If true, automatically adjusts the grid's height to fit the entire content without scrolling.
Defined in
cellFlashingCssClass?
optionalcellFlashingCssClass:string
CSS class applied to cells with a flashing effect. Default is "flashing".
Defined in
columns?
optionalcolumns:Column<TItem>[]
Array of column definitions for the grid.
Defined in
createPreHeaderPanel?
optionalcreatePreHeaderPanel:boolean
Defaults to false. If true, creates an extra pre-header panel for column grouping.
Defined in
dataItemColumnValueExtractor()?
optionaldataItemColumnValueExtractor: (item,column) =>void
Function to extract column values from data items, used for custom copy buffer operations. Default is null.
Parameters
item
TItem
column
Column<TItem>
Returns
void
Defined in
defaultColumnWidth?
optionaldefaultColumnWidth:number
Defaults to 80. Default width of columns in pixels.
Defined in
defaultFormat?
optionaldefaultFormat:ColumnFormat<TItem>
Default formatting options for columns. Default is defaultColumnFormat.
Defined in
defaultFormatter?
optionaldefaultFormatter:CompatFormatter<TItem>
Default formatter function for cells.
Defined in
editable?
optionaleditable:boolean
Defaults to false. If true, cells can be edited inline.
Defined in
editCommandHandler()?
optionaleditCommandHandler: (item,column,command) =>void
Function to handle edit commands, useful for implementing custom undo support. Default is null.
Parameters
item
TItem
column
Column<TItem>
command
Returns
void
Defined in
editorCellNavOnLRKeys?
optionaleditorCellNavOnLRKeys:boolean
Defaults to false. If true, enables navigation between cells using left and right arrow keys within the editor.
Defined in
editorFactory?
optionaleditorFactory:EditorFactory
Factory function for creating custom editors. Default is null.
Defined in
editorLock?
optionaleditorLock:EditorLock
Global editor lock instance, used for managing concurrent editor access. Default is GlobalEditorLock.
Defined in
emptyNode()?
optionalemptyNode: (node) =>void
Function to handle clearing a DOM node, used for custom cleanup logic. Default is null.
Parameters
node
Element
Returns
void
Defined in
enableAddRow?
optionalenableAddRow:boolean
Defaults to false. If true, enables the ability to add new rows to the grid.
Defined in
enableAsyncPostRender?
optionalenableAsyncPostRender:boolean
Defaults to false. If true, enables asynchronous post-rendering.
Defined in
enableAsyncPostRenderCleanup?
optionalenableAsyncPostRenderCleanup:boolean
Defaults to false. If true, enables cleanup after asynchronous post-rendering.
Defined in
enableCellNavigation?
optionalenableCellNavigation:boolean
Defaults to true. If true, enables cell navigation with arrow keys.
Defined in
enableCellRangeSelection?
optionalenableCellRangeSelection:boolean
Defaults to false. If true, allows selection of cell ranges.
Defined in
enableColumnReorder?
optionalenableColumnReorder:boolean
Defaults to true. If true, enables column reordering.
Defined in
enableRowReordering?
optionalenableRowReordering:boolean
Defaults to false. If true, enables row reordering.
Defined in
enableTabKeyNavigation?
optionalenableTabKeyNavigation:boolean
Defaults to true. If true, enables navigation between cells using the Tab key.
Defined in
enableTextSelectionOnCells?
optionalenableTextSelectionOnCells:boolean
Defaults to false. If true, enables text selection within cells.
Defined in
explicitInitialization?
optionalexplicitInitialization:boolean
Defaults to false. If true, requires explicit initialization of the grid.
Defined in
footerRowHeight?
optionalfooterRowHeight:number
Defaults to 30. Height of the footer row in pixels.
Defined in
forceFitColumns?
optionalforceFitColumns:boolean
Defaults to false. If true, forces columns to fit the grid width.
Defined in
forceSyncScrolling?
optionalforceSyncScrolling:boolean
Defaults to false. If true, synchronizes scrolling between the grid and its container.
Defined in
forceSyncScrollInterval?
optionalforceSyncScrollInterval:number
Defaults to 250. Interval in milliseconds for synchronizing scrolling when forceSyncScrolling is enabled.
Defined in
formatterFactory?
optionalformatterFactory:FormatterFactory<any>
Factory function for creating custom formatters. Default is null.
Defined in
frozenBottom?
optionalfrozenBottom:boolean
Defaults to false. If true, places frozen rows at the bottom edge of the grid.
Defined in
frozenColumns?
optionalfrozenColumns:number
Defaults to undefined. If specified, freezes the given number of columns on the left edge of the grid.
Prefer setting column.frozen = 'true' for individual columns as this is only for compatibility.
Defined in
frozenRows?
optionalfrozenRows:number
Defaults to undefined. If specified, freezes the given number of rows at the top or bottom
edge of the grid based on frozenBottom.
Defined in
fullWidthRows?
optionalfullWidthRows:boolean
Defaults to false. If true, makes rows take the full width of the grid.
Defined in
groupingPanel?
optionalgroupingPanel:boolean
Defaults to false. If true, shows the grouping panel for grouping columns.
Defined in
groupingPanelHeight?
optionalgroupingPanelHeight:number
Defaults to 30. Height of the grouping panel in pixels.
Defined in
groupTotalsFormatter()?
optionalgroupTotalsFormatter: (p1?,p2?,grid?) =>string
Function to format group totals for display in the grouping panel.
Parameters
p1?
GroupTotals<TItem>
p2?
Column<TItem>
grid?
any
Returns
string
Defined in
headerRowHeight?
optionalheaderRowHeight:number
Defaults to 30. Height of the header row in pixels.
Defined in
jQuery?
optionaljQuery:object
jQuery object for compatibility or custom integration purposes. Default is undefined unless jQuery is available in the global object (e.g. window).
fn
fn:
any
ready
ready:
any
Defined in
layoutEngine?
optionallayoutEngine:LayoutEngine
Layout engine for custom grid layouts. Default is BasicLayout. Use FrozenLayout to enable frozen columns / rows.
Defined in
leaveSpaceForNewRows?
optionalleaveSpaceForNewRows:boolean
Defaults to false. If true, leaves space for new rows in the DOM visible buffer.
Defined in
minBuffer?
optionalminBuffer:number
Defaults to 3. Minimum number of rows to keep in the buffer.
Defined in
multiColumnSort?
optionalmultiColumnSort:boolean
Defaults to false. If true, allows sorting by multiple columns simultaneously.
Defined in
multiSelect?
optionalmultiSelect:boolean
Defaults to true. If true, enables multiple cell selection.
Defined in
preHeaderPanelHeight?
optionalpreHeaderPanelHeight:number
Sets grouping panel height. Default is undefined, e.g. it is set via CSS.
Defined in
removeNode()?
optionalremoveNode: (node) =>void
Function to handle removing a DOM node, used for custom cleanup logic. Default is null or jQuery.remove if available.
Parameters
node
Element
Returns
void
Defined in
renderAllCells?
optionalrenderAllCells:boolean
Defaults to false. If true, renders all cells (row columns) in the viewport, at the cost of higher memory usage and reduced performance.
Defined in
renderAllRows?
optionalrenderAllRows:boolean
Defaults to false. If true, renders all rows in the viewport, at the cost of higher memory usage and reduced performance.
When both renderAllCells and renderAllRows are true, all cells in the grid are rendered (e.g. virtualization is disabled),
which can be very slow for large datasets, but may be desired to keep all rows and cells in the DOM for accessibility purposes,
proper tabbing and screen reader support.
Defined in
rowHeight?
optionalrowHeight:number
Defaults to 30. Height of rows in pixels.
Defined in
rtl?
optionalrtl:boolean
Default is based on document element's (<html/>) dir property.. If true, enables right-to-left text direction.
Defined in
sanitizer()?
optionalsanitizer: (dirtyHtml) =>string
Optional function for sanitizing HTML strings to avoid XSS attacks.
Default is DOMPurify.sanitize if available globally, otherwise falls back to basicRegexSanitizer.
Parameters
dirtyHtml
string
Returns
string
Defined in
selectedCellCssClass?
optionalselectedCellCssClass:string
CSS class applied to selected cells. Default is "selected".
Defined in
showCellSelection?
optionalshowCellSelection:boolean
Defaults to true. If true, shows cell selection indicators.
Defined in
showColumnHeader?
optionalshowColumnHeader:boolean
Defaults to true. If true, displays the column header.
Defined in
showFooterRow?
optionalshowFooterRow:boolean
Defaults to false. If true, displays the footer row.
Defined in
showGroupingPanel?
optionalshowGroupingPanel:boolean
Defaults to true. If true, displays the grouping panel.
Defined in
showHeaderRow?
optionalshowHeaderRow:boolean
Defaults to false. If true, displays the header row.
Defined in
showPreHeaderPanel?
optionalshowPreHeaderPanel:boolean
Defaults to false. If true, displays the pre-header panel for column grouping.
Defined in
showTopPanel?
optionalshowTopPanel:boolean
Defaults to false. If true, displays the top panel for additional controls or information.
Defined in
suppressActiveCellChangeOnEdit?
optionalsuppressActiveCellChangeOnEdit:boolean
Defaults to false. If true, suppresses the activation of cells when they contain an editor and are clicked.
Defined in
syncColumnCellResize?
optionalsyncColumnCellResize:boolean
Defaults to false. If true, synchronizes column resizing with cell resizing.
Defined in
topPanelHeight?
optionaltopPanelHeight:number
Defaults to 30. Height of the top panel in pixels.
Defined in
useCssVars?
optionaluseCssVars:boolean
Defaults to false. If true, uses CSS variables for styling.
Defined in
useLegacyUI?
optionaluseLegacyUI:boolean
Defaults to false. If true, uses legacy jQuery UI classes like ui-state-default and ui-widget-content.
Defined in
viewportClass?
optionalviewportClass:string
CSS class applied to the viewport container. Default is undefined.