Grid API
ColumnApi<T>
Provides methods for managing columns within Graphite Grid, including functionalities for configuration, visibility, and dynamic adjustments based on user interactions or data changes.
Type parameters
Type parameter |
---|
T |
Properties
- Name
arePivotColumnsPending
- Type
- () => boolean
- Description
Determines whether there are pending operations for pivot columns, typically indicated by unresolved promises from a controlled source. This method provides feedback on the loading state of pivot columns, allowing for UI adjustments or notifications while data is being processed.
- Name
calculateColumnFieldExn
- Type
- (column: ColumnOrColumnId<T>, data: T) => unknown
- Description
Calculates the field value for a given column and row data, throwing an exception if the column's field configuration is invalid. This method ensures that field values are correctly computed based on column settings, providing accurate data for display and interaction.
- Name
calculateColumnInFilterKeyExn
- Type
- (column: ColumnOrColumnId<T>, data: T) => string
- Description
Calculates the filter key for a given column and row data, used in determining row visibility during filter operations. This method throws an exception if the column does not support filtering, ensuring that filter operations are only performed on compatible columns.
- Name
calculateQuickSearchKeyExn
- Type
- (column: ColumnOrColumnId<T>, data: T) => string
- Description
Calculates the quick search key for a given column and row data, throwing an exception if the column is not configured for quick searching. This method enables efficient search operations within the grid, allowing for rapid filtering based on user input and column data.
- Name
collapseColumnGroup
- Type
- (id: string) => void
- Description
Collapses a specified column group, hiding its columns and condensing the grid layout to reflect the reduced content.
- Name
disableMarkerColumn
- Type
- () => void
- Description
Disables and hides the marker column if it is currently enabled, removing it from the grid view and interaction.
- Name
disableStickyHeaderLabel
- Type
- () => void
- Description
Disables the
stickyHeaderLabel
property if it is currently enabled, allowing header labels to scroll out of view.
- Name
enableMarkerColumn
- Type
- () => void
- Description
Enables the marker column if it is currently disabled, making it visible and functional within the grid.
- Name
enableStickyHeaderLabel
- Type
- () => void
- Description
Enables the
stickyHeaderLabel
property if it is currently disabled, ensuring header labels remain visible during scrolling.
- Name
expandColumnGroup
- Type
- (id: string) => void
- Description
Expands a specified column group, making all columns within the group visible and adjusting the grid layout to accommodate the expanded content.
- Name
getBaseColumnDefinition
- Type
- () => BaseColumnDefinition<T>
- Description
Retrieves the current base column definition used by the grid, which may be a static value or a function generating such a value.
- Name
getColumnById
- Type
- (columnId: string) => null | ColumnDefinition<T>
- Description
Retrieves a column definition based on a given column Id, returning
null
if the column is not found. This method supports both regular and pivot columns, providing a unified approach to accessing column data.
- Name
getColumnDefinitions
- Type
- () => ColumnDefinition<T>[]
- Description
Retrieves all column definitions currently configured in the grid
- Name
getColumnGroupExpansions
- Type
- () => Record<string, null | boolean>
- Description
Retrieves the current expansion states of column groups, providing insight into which groups are expanded or collapsed.
- Name
getColumnIdPathDelimiter
- Type
- () => string
- Description
Retrieves the delimiter used to join column group Ids within the grid
- Name
getColumnPin
- Type
- (column: ColumnOrColumnId<T>) => ColumnPin
- Description
Retrieves the current pin state of a specified column, indicating whether it is pinned to the start or end of the grid or not pinned at all. Pinning affects the column's visibility relative to the grid's scrolling behavior, keeping it accessible despite scroll position.
- Name
getColumns
- Type
- () => ColumnDefinition<T>[]
- Description
Retrieves the current set of column definitions used by the grid, which may include definitions for pivot columns if pivot mode is active. This method provides a unified interface for accessing all active column configurations, regardless of their specific roles within the grid.
- Name
getMarkerColumnDefinition
- Type
- () => MarkerColumnDefinition<T>
- Description
Retrieves the current marker column definition used by the grid, allowing for updates or queries on this special column type.
- Name
getPivotColumnDefinitions
- Type
- () => ColumnDefinition<T>[]
- Description
Retrieves the current definitions for pivot columns in use by the grid, providing a view of how data is currently structured in pivot mode. This method ensures that pivot configurations are transparent and accessible for management and adjustment.
- Name
getPivotColumnGroupExpansions
- Type
- () => Record<string, null | boolean>
- Description
Retrieves the current expansion states of pivot column groups, similar to
getColumnGroupExpansions
but specific to pivot settings.
- Name
getPivotColumnIdPrefix
- Type
- () => string
- Description
Retrieves the prefix used for pivot column Ids within the grid, providing insight into how pivot columns are identified and managed. This method aids in the customization and understanding of pivot column configurations, ensuring consistency across grid operations.
- Name
getPivotColumnModel
- Type
- () => string[]
- Description
Retrieves the current model for pivot columns used by the grid, reflecting the active configuration for data pivoting.
- Name
getPivotColumnSource
- Type
- () => null | "client" | PivotColumnSourceClient<T> | PivotColumnSourceControlled<T>
- Description
Retrieves the current source configuration for pivot columns within the grid, detailing how pivot columns are generated and managed.
- Name
getVisibleColumnHierarchy
- Type
- () => ColumnGroupHierarchy<T>
- Description
Retrieves the current hierarchy of visible column headers within the grid, presenting a structured view of header relationships and groupings. This method enhances the management of complex header layouts, particularly in grids with multiple levels of column grouping.
- Name
getVisibleColumns
- Type
- () => PartitionedColumns<T>
- Description
Retrieves the currently visible columns within the grid, organized by their pin state. This method provides a detailed view of which columns are actively displayed in the grid, aiding in layout management and user interaction.
- Name
hideColumn
- Type
- (column: ColumnOrColumnId<T>) => void
- Description
Hides a specified column within the grid, removing it from view but not from the grid's data model.
- Name
isColumnGroupExpanded
- Type
- (id: string) => boolean
- Description
Determines if a specified column group can be collapsed or expanded, based on the visibility settings of its constituent columns. This method ensures that column groups with configurable visibility can be dynamically adjusted by the user.
- Name
isColumnHidable
- Type
- (column: ColumnOrColumnId<T>) => boolean
- Description
Retrieves the hidable status of a specified column, indicating whether it can be hidden by user interaction or grid settings. This method helps manage user interface elements related to column visibility and customization.
- Name
isColumnHidden
- Type
- (column: ColumnOrColumnId<T>) => boolean
- Description
Determines if a specified column is currently hidden, considering both explicit visibility settings and group collapse states. This method provides a comprehensive check that accounts for all factors influencing a column's visibility.
- Name
isColumnPinnable
- Type
- (column: ColumnOrColumnId<T>) => boolean
- Description
Determines if a specified column is pinnable, indicating whether it can be fixed to a specific position within the grid. This status influences user interface options related to column layout customization.
- Name
isMarkerColumnEnabled
- Type
- () => boolean
- Description
Returns true if the marker column is enabled
- Name
isPivotColumn
- Type
- (column: ColumnOrColumnId<T>) => boolean
- Description
Determines if a specified column is a pivot column, providing a method to distinguish pivot columns from regular columns within the grid. This functionality is crucial for managing interactions and displays specific to pivot columns, enhancing the grid's dynamic capabilities.
- Name
isPivotModeOn
- Type
- () => boolean
- Description
Determines whether column pivot mode is currently active within the grid, influencing how data is displayed and interacted with. This method allows for the dynamic control of pivot operations, enabling or disabling data pivoting based on user needs or data characteristics.
- Name
pinColumnEnd
- Type
- (column: ColumnOrColumnId<T>) => void
- Description
Pins a specified column to the end of the grid, ensuring it remains visible at the end of the column layout regardless of scrolling.
- Name
pinColumnStart
- Type
- (column: ColumnOrColumnId<T>) => void
- Description
Pins a specified column to the start of the grid, ensuring it remains visible at the beginning of the column layout regardless of scrolling.
- Name
setBaseColumnDefinition
- Type
- (b: BaseColumnDefinition<T>) => void
- Description
Sets a new base column definition for the grid to use, influencing the default settings for all columns.
- Name
setColumnDefinitionsExn
- Type
- (newDefs: ColumnDefinition<T>[]) => void
- Description
Sets new column definitions for the grid, potentially throwing an exception if duplicate column Ids are detected. This method allows dynamic updates to column configurations, ensuring the grid reflects changes in data or user preferences.
- Name
setMarkerColumnDefinition
- Type
- (column: MarkerColumnDefinition<T>) => void
- Description
Sets a new marker column definition for the grid to use, updating the visual and functional aspects of the marker column.
- Name
setPivotColumnModel
- Type
- (newModel: string[]) => void
- Description
Sets a new model for pivot columns within the grid, updating the grid's data display and interaction based on the specified column Ids.
- Name
setPivotColumnSource
- Type
- (newSource: null | "client" | PivotColumnSourceClient<T> | PivotColumnSourceControlled<T>) => void
- Description
Sets a new source for pivot columns within the grid, updating the method by which pivot columns are created and integrated into the grid layout.
- Name
showColumn
- Type
- (column: ColumnOrColumnId<T>) => void
- Description
Shows a previously hidden column within the grid, adding it back to the visible grid layout.
- Name
splitColumnGroupId
- Type
- (id: string) => string[]
- Description
Splits a column group Id into its constituent parts based on the
columnIdPathDelimiter
, providing a clear view of the group's hierarchy. This method aids in understanding the structure of complex column groups within the grid.
- Name
toggleColumn
- Type
- (column: ColumnOrColumnId<T>) => void
- Description
Toggles the visibility of a specified column within the grid, switching it between hidden and visible states.
- Name
toggleColumnGroup
- Type
- (id: string) => void
- Description
Toggles the expansion state of a specified column group, switching it between expanded and collapsed states.
- Name
toggleMarkerColumn
- Type
- () => void
- Description
Toggles the enabled state of the marker column, switching it between active and inactive states.
- Name
togglePivotMode
- Type
- () => void
- Description
Toggles the active state of column pivot mode, switching between enabled and disabled states based on the current configuration.
- Name
toggleStickyHeaderLabel
- Type
- () => void
- Description
Toggles the enabled state of the
stickyHeaderLabel
property, adjusting header visibility settings based on current grid behavior.
- Name
turnPivotModeOff
- Type
- () => void
- Description
Deactivates column pivot mode if it is currently enabled, reverting the grid's display to standard column configurations.
- Name
turnPivotModeOn
- Type
- () => void
- Description
Activates column pivot mode if it is currently disabled, transforming the grid's display to reflect pivoted data configurations.
- Name
unpinColumn
- Type
- (column: ColumnOrColumnId<T>) => void
- Description
Unpins a previously pinned column, removing its fixed position and allowing it to participate in normal scrolling behavior.
- Name
updateColumnDefinitionExn
- Type
- (c: ColumnOrColumnId<T>, updates: Omit<ColumnDefinition<T>, "id">) => void
- Description
Updates properties of a specified column, accepting either a column Id or definition and a set of properties to update. This method allows dynamic customization of column settings, adapting to changes in data or user preferences.