Vue Data GridColumn API
Below are listed all the column API methods.
Some of the API methods take Column Key (named colKey
) which has type Column | string
. This means you can pass either a Column
object (that you receive from calling one of the other methods) or you pass in the Column ID (which is a string
). The Column ID is a property of the column definition. If you do not provide the Column ID, the grid will create one for you (first by trying to use the field if it is unique, otherwise it will generate an ID).
Column Groups
See Column Groups
| Returns the column group with the given name. See Column Groups.
| |
| Returns the provided column group with the given name.
| |
| Call this if you want to open or close a column group.
|
Columns
| Returns the column with the given colKey , which can either be the colId (a string) or the colDef (an object).
| |
| Returns all the columns, regardless of visible or not.
| |
| Returns all the grid columns, same as getColumns() , except a) it has the order of the columns that are presented in the grid b) it's after the 'pivot' step, so if pivoting, has the value columns for the pivot.
|
Moving
See Column Moving
| Moves a column to toIndex . The column is first removed, then added at the toIndex location, thus index locations will change to the right of the column after the removal.
| |
| Same as moveColumn but works on list.
| |
| Same as moveColumn but works on index locations.
|
Pinning
See Column Pinning
| Returns true if pinning left or right, otherwise false .
| |
| Returns true if pinning left, otherwise false .
| |
| Returns true if pinning right, otherwise false .
| |
| Sets the column pinned / unpinned. Key can be the column ID, field, ColDef object or Column object.
| |
| Same as setColumnPinned , but provide a list of column keys.
|
Pivoting
See Pivoting
| Get the pivot mode.
| |
| Set the pivot mode.
| |
| Get the pivot columns.
| |
| Set the pivot columns.
| |
| Add a pivot column.
| |
| Same as addPivotColumn but provide a list of columns.
| |
| Remove a pivot column.
| |
| Same as removePivotColumn but provide a list of columns.
| |
| Returns the pivot result column for the given pivotKeys and valueColId . Useful to then call operations on the pivot column. | |
| Set the pivot result columns.
| |
| Returns the grid's pivot result columns. See Columns vs Pivot Result Columns.
|
Row Grouping
See Row Grouping
| Get row group columns.
| |
| Set the row group columns.
| |
| Add a column to the row groups.
| |
| Same as addRowGroupColumn but provide a list of columns.
| |
| Remove a column from the row groups.
| |
| Same as removeRowGroupColumn but provide a list of columns.
| |
| Move the column to a new position in the row grouping order.
|
Sizing
See Column Sizing
| Sets the column width on a single column. The finished flag gets included in the resulting event and not used internally by the grid. The finished flag is intended for dragging, where a dragging action will produce many columnWidth events, so the consumer of events knows when it receives the last event in a stream. The finished parameter is optional, and defaults to true .
| |
| Sets the column widths on multiple columns. This method offers better performance than calling setColumnWidth multiple times. The finished flag gets included in the resulting event and not used internally by the grid. The finished flag is intended for dragging, where a dragging action will produce many columnWidth events, so the consumer of events knows when it receives the last event in a stream. The finished parameter is optional, and defaults to true .
| |
| Gets the grid to size the columns to the specified width in pixels, e.g. sizeColumnsToFit(900) . To have the grid fit the columns to the grid's width, use the Grid API gridApi.sizeColumnsToFit() instead.
| |
| Auto-sizes a column based on its contents.
| |
| Same as autoSizeColumn , but provide a list of column keys.
| |
| Calls autoSizeColumns on all displayed columns.
|
State
See Column State
| Gets the state of the columns. Typically used when saving column state.
| |
| Applies the state of the columns from a previous state. Returns false if one or more columns could not be found.
| |
| Sets the state back to match the originally provided column definitions.
| |
| Gets the state of the column groups. Typically used when saving column group state.
| |
| Sets the state of the column group state from a previous state.
| |
| Sets the state back to match the originally provided column definitions.
|
Value Columns
Methods for management of value column aggregates (for aggregating when grouping or pivoting).
| Get a list of the existing value columns.
| |
| Add the given column to the set of existing value columns.
| |
| Like addValueColumn but add the given list of columns to the existing set of value columns.
| |
| Remove the given column from the existing set of value columns.
| |
| Like removeValueColumn but remove the given list of columns from the existing set of value columns.
| |
| Set the value columns to the provided list of columns.
| |
| Sets the agg function for a column. aggFunc can be one of the built-in aggregations or a custom aggregation by name or direct function.
|
Visibility and Display
| Sets the visibility of a column. Key can be the column ID or Column object.
| |
| Same as setColumnVisible , but provide a list of column keys.
| |
| Returns the display name for a column. Useful if you are doing your own header rendering and want the grid to work out if headerValueGetter is used, or if you are doing your own column management GUI, to know what to show as the column name.
| |
| Returns the display name for a column group (when grouping columns).
| |
| Returns the column to the right of the provided column, taking into consideration open / closed column groups and visible columns. This is useful if you need to know what column is beside yours e.g. if implementing your own cell navigation. | |
| Same as getVisibleColAfter except gives column to the left. | |
| Same as getAllGridColumns() , except only returns rendered columns, i.e. columns that are not within the viewport and therefore not rendered, due to column virtualisation, are not displayed.
| |
| Returns all columns currently displayed (e.g. are visible and if in a group, the group is showing the columns) for the pinned left, centre and pinned right portions of the grid.
| |
| Same as getAllDisplayedColumns but just for the center portion of the grid.
| |
| Same as getAllDisplayedColumns but just for the pinned left portion of the grid.
| |
| Same as getAllDisplayedColumns but just for the pinned right portion of the grid.
| |
| Returns all 'root' column headers. If you are not grouping columns, these return the columns. If you are grouping, these return the top level groups - you can navigate down through each one to get the other lower level headers and finally the columns at the bottom.
| |
| Same as getAllDisplayedColumnGroups but just for the center portion of the grid.
| |
| Same as getAllDisplayedColumnGroups but just for the pinned left portion of the grid.
| |
| Same as getAllDisplayedColumnGroups but just for the pinned right portion of the grid.
|