Skip to content

Grid options ​

Options are passed with the options prop. All options are optional.

ts
import type { GridOptions } from "@datagrid/vue-ui";

const options: GridOptions<Person> = {
  rowId: (data) => data.id,
  defaultColumn: { sortable: true, filterable: true },
};

Data ​

OptionTypeDefaultDescription
rowId(data, index, parent) => string | numberindexunique id of a row, see row ids
childrenFieldstring"children"property with child rows (tree data)
dataGetter(params) => Promise<{ data, total }>–server side data
infiniteScrollboolean | { blockSize }falseload rows block by block while scrolling, see infinite scrolling
loadingbooleanfalseshows the loading indicator

Columns ​

OptionTypeDefaultDescription
defaultColumnPartial<ColumnConfig>–properties for all columns
columnTypesRecord<string, Partial<ColumnConfig>>–reusable column configurations
columnMenubooleanfalsecolumn menu button for all columns
rowNumbersbooleanfalsecolumn with row numbers
checkboxSelectionbooleanfalsecolumn with selection checkboxes

Rows ​

OptionTypeDefaultDescription
rowHeightnumber | (row) => numbermeasuredfixed row height
estimatedRowHeightnumber32height of rows which are not measured yet
headerRowHeightnumber38 (CSS)height of header rows
filterRowHeightnumber36 (CSS)height of the filter row
rowClass(row) => string | string[]–css classes of a row
rowStyle(row) => style–inline styles of a row
rowExpandable(row) => boolean–which tree / group rows can be expanded
hasDetails(row, data) => boolean–which rows have details
renderDetails(row, data) => component–alternative to the detail slot
animationEnabledbooleanfalseanimates rows after sorting and filtering

Selection ​

OptionTypeDefaultDescription
selection"None" | "Row" | "Cell""None"selection mode ("Row" if checkboxSelection is set)
singleSelectbooleantrue (false with checkboxSelection)only one row / cell
rowSelectable(row) => boolean–which rows can be selected
emptySelectionAllowedbooleantrueallow deselecting the last row

Sorting & filtering ​

OptionTypeDefaultDescription
sortingOrder("asc" | "desc" | null)[]["asc", "desc", null]order of directions when clicking a header
multiSortKey"shift" | "ctrl""shift"modifier key for multi column sorting
filterFn(rows, columns, value) => rows–custom quick filter

Grouping ​

OptionTypeDefaultDescription
groupDefaultExpandednumber0expanded levels of new groups (-1 = all)
groupShowCountbooleantruenumber of rows in group rows
totalRow"top" | "bottom"–row with aggregated values
groupFooterbooleanfalsefooter row with the aggregations below each expanded group
stickyGroupRowsbooleanfalsegroup rows of the rows at the top stay visible while scrolling

Pagination ​

OptionTypeDefaultDescription
pagination.enabledbooleanfalse
pagination.pageSizenumber25
pagination.pageSizesnumber[][10, 25, 50, 100]options of the page size selector

Editing & clipboard ​

OptionTypeDefaultDescription
editTrigger"dblclick" | "click" | "none""dblclick"mouse action which starts editing
enterMovesDownbooleanfalsemove to the cell below after Enter
clipboardbooleantruecopy & paste
copyHeadersbooleanfalsecopy the headers too
fillHandlebooleanfalsehandle to fill cells by dragging (requires selection: "Cell"), see spreadsheet features
undoRedobooleantrueundo / redo cell changes with Ctrl + Z / Ctrl + Y
undoLimitnumber50maximum number of undo steps
OptionTypeDefaultDescription
contextMenuboolean | ContextMenuItem[] | (params, defaultItems) => ContextMenuItem[]falsebuilt-in context menu of cells
statusBarboolean | { items }falsestatus bar with row counts and aggregations of the selected cells

Localization ​

OptionTypeDefaultDescription
localestring"en""en", "de" or a registered locale
localeTextRecord<string, string>–override single texts
localize(key) => string–custom translation function

Virtualization ​

OptionTypeDefaultDescription
virtualization.bufferRownumber1rows rendered outside of the viewport
virtualization.bufferColumnnumber1columns rendered outside of the viewport

Released under the ISC License.