New to Kendo UI for Vue? Start a free 30-day trial

GridProps

Interface

Represents the props of the Kendo UI for Vue Grid component.

Definition

Package:@progress/kendo-vue-grid

Properties

Deprecated. Not needed any more.

When set to true, the Grid restarts the row alternation in each group, so every group starts with a row of the same color. Known limitation: when you use virtual scrolling with groups and set alternatePerGroup to true, the alternating rows in large groups may flicker slightly. In this case, use row templates and set the row alternation based on the data or dataItems.

autoProcessData?

boolean | AutoProcessDataConfig

Enables built-in data processing in the Grid based on its state. The Grid handles data operations such as sorting, filtering, grouping, and paging for you.

Default:

false

Example:
vue
<Grid
  :auto-process-data="{
    filter: true,
    search: true,
    sort: true,
    group: true,
    page: true
  }"
/>

cellRender?

string | boolean | (h: any, defaultRendering: any, props: GridCellProps, listeners: any) => any

obsolete Will be removed in the next major release. Use the cells prop instead.

Defines a custom rendering for the cells.

Defines a set of custom cell components that the Grid renders instead of the default cells.

Example:
vue
<Grid
  :cells="{
    data: CustomCell
  }"
/>

clipboard?

boolean | ClipboardSettings

Enables the copy, cut, and paste clipboard actions. Accepts ClipboardSettings or a boolean value.

Example:
vue
<Grid :clipboard="true" />

Deprecated Use groupExpand instead.

Passes the collection of all collapsed groups for every group level.

Default:

[]

Defines whether the Grid shows the column menu for its columns. Accepts a boolean, a Vue component, a render function, or a slot name.

columnMenuAnimate?

boolean | PopupAnimation

Controls the animation of the column menu. By default, the Grid animates the opening and closing of the menu.

Default:

true

Overrides the default column menu icon (three vertical dots) for the whole Grid. You can override it for a single column with the (menuIcon) property.

Sets the properties of the columns that the Grid uses.

The collection of column states of the Grid.

Enables the virtualization of the columns. When you enable it, the Grid does not render the columns outside the view.

Configures the context menu of the Grid. When set to true, the Grid renders the default context menu. Pass a GridContextMenuOptions object to configure the header and body items separately, or a function that returns the configuration based on the cell options.

Example:
vue
<Grid :context-menu="true" />

Enables the CSV export when set to true, or sets the CSV export options.

Example:
vue
<Grid :csv="true" />

Sets the field of the data item that the Grid uses as the row key. If you do not set it, the Grid uses the index of the data item as the row key. This can stop rows from updating during paging or scrolling.

dataItems?

any[] | DataResult

Sets the data of the Grid (see example). If you use paging, the dataItems option must contain only the items for the current page.

The default collection of column states of the Grid.

defaultDetailExpand?

DetailExpandDescriptor

The default detailExpand state that the Grid applies in uncontrolled mode.

Example:
vue
<Grid :default-detail-expand="{ 2: true, 4: true }" />

defaultFilter?

CompositeFilterDescriptor

The default descriptor by which the Grid filters the data (more information and examples).

defaultGroup?

GroupDescriptor[]

The default group state that the Grid applies in uncontrolled mode.

Example:
vue
<Grid :default-group="[{ field: 'CategoryName' }]" />

defaultGroupExpand?

GroupExpandDescriptor[]

The default groupExpand state that the Grid applies in uncontrolled mode.

Example:
vue
<Grid :default-group-expand="[{ field: 'CategoryName', expanded: true }]" />

The default pinnedBottomRows state that the Grid applies in uncontrolled mode. Requires pinnable set to true.

Example:
vue
<Grid :pinnable="true" :default-pinned-bottom-rows="[products[9]]" />

The default pinnedTopRows state that the Grid applies in uncontrolled mode. Requires pinnable set to true.

Example:
vue
<Grid :pinnable="true" :default-pinned-top-rows="[products[0]]" />

defaultSearch?

CompositeFilterDescriptor

The default descriptor by which the Grid searches the data. Its first FilterDescriptor fills the GridSearchBox.

Example:
vue
<Grid :default-search="{ logic: 'or', filters: [{ field: 'category', operator: 'eq', value: 'electronics' }] }" />

defaultSelect?

SelectDescriptor

The default select state that the Grid applies in uncontrolled mode.

Example:
vue
<Grid :default-select="{ ['item-data-key-id']: true }" />

The default skip state that the Grid applies in uncontrolled mode.

Example:
vue
<Grid :default-skip="10" />

defaultSort?

SortDescriptor[]

The default descriptors by which the Grid sorts the data in uncontrolled mode. The Grid applies the sorting styles and buttons to the affected columns.

The default take state that the Grid applies in uncontrolled mode.

Example:
vue
<Grid :default-take="20" />

Specifies a custom rendering that the Grid clones and renders inside the detail rows of the expanded items (see example). Accepts a Vue component, a render function, or a slot name. The expand feature works when you set dataItemKey.

detailExpand?

DetailExpandDescriptor

The descriptor by which the Grid expands the detail rows.

Example:
vue
<Grid :detail-expand="{ 1: true, 3: true }" />

Defines the height of the detail row and makes all detail rows the same height.

dir?

string

Sets the dir HTML attribute of the Grid wrapper element. Use 'rtl' to enable right-to-left rendering.

Example:
vue
<Grid :dir="'rtl'" />

Specifies the name of the field that provides a boolean representation of the edit state of the current item (more information and examples).

Defines the GridColumnProps of the expand column.

obsolete Will be removed in the next major release. Set dataItemKey property instead.

Specifies the name of the field that provides a boolean representation of the expanded state of the item (see example).

filter?

CompositeFilterDescriptor

The descriptor by which the Grid filters the data (more information and examples). It affects the values and buttons in the FilterRow of the Grid.

Enables filtering for the columns that have their field option set (more information and examples).

obsolete Will be removed in the next major release. Use the cells.filterCell prop instead.

Defines a custom rendering for the filter cells.

Sets the filter operators that the Grid filters use.

Determines whether the Grid keeps the scroll position after a data change. When set to true, the scroll stays in the same position.

group?

GroupDescriptor[]

The descriptors by which the Grid groups the data (more information and examples).

Determines whether the user can group the data by dragging and dropping the column headers (more information and examples).

groupExpand?

GroupExpandDescriptor[]

The descriptor by which the Grid expands the groups.

Example:
vue
<Grid :group-expand="[{ field: 'CategoryName', expanded: true }]" />

obsolete Will be removed in the next major release. Use the cells.headerCell prop instead.

Defines a custom rendering for the header cells.

highlight?

{ [id: string]: boolean | { [id: string]: boolean } }

The descriptor that defines the highlight state of an item. Pass a boolean value to highlight the whole row. Pass an object to highlight individual cells by their field.

id?

string

Sets the id attribute of the top div element of the Grid.

Example:
vue
<Grid :id="'custom-grid-id'" />

loader?

string | Object | Function

The boolean option is Deprecated. Use showLoader instead.

Defines the loader of the Grid. Accepts a slot name, a render function, or a Vue component.

Defines whether the group descriptor columns are locked (frozen or sticky). Locked columns stay visible while the user scrolls the Grid horizontally. Defaults to false.

Example:
vue
<Grid :lock-groups="true" />

When set to true, the user can use dedicated keyboard shortcuts to interact with the Grid. By default, keyboard navigation is off and the Grid content follows the normal tab sequence.

Default:

false

onCancel?

(event: GridCancelEvent) => void

Fires when the user triggers a canceling operation from a cell.

Parameters:eventGridCancelEvent

onCellclick?

(event: any) => void

Fires when the user clicks a cell.

Parameters:eventany

onClipboard?

(event: GridClipboardEvent) => void

Fires when you enable clipboard support and the user triggers one of the actions, for example, copy. Receives a GridClipboardEvent object.

Parameters:eventGridClipboardEvent
Example:
vue
<Grid
  :clipboard="true"
  @clipboard="handleClipboard"
/>

Fires when the user reorders the columns.

Parameters:eventGridColumnReorderEvent

Fires when the user resizes a column.

Parameters:eventGridColumnResizeEvent

Fires when the user opens the context menu on a cell.

Parameters:eventGridContextMenuEvent
Example:
vue
<Grid @contextmenu="handleContextMenu" />

Fires when the user clicks a context menu item.

Parameters:eventGridContextMenuItemClickEvent
Example:
vue
<Grid @contextmenuitemclick="handleItemClick" />

A callback that receives the raw source data (before sorting, filtering, and grouping) and returns a transformed array. Use it to filter out rows or change values before the Grid creates the CSV file. The Grid then applies its data operations (sort, filter, group) to the returned array before the export.

Parameters:dataany[]Returns:

any[]

Example:
vue
<Grid :on-csvexport="(data) => data.filter(item => item.active)" />

Fires when the data state of the Grid changes.

Parameters:eventGridDataStateChangeEvent

Fires when the user expands or collapses a detail row.

onEdit?

(event: GridEditEvent) => void

Fires when the user triggers an edit operation from a cell.

Parameters:eventGridEditEvent

Deprecated. Use onDetailexpandchange or onGroupexpandchange instead.

Fires when the user expands or collapses an item.

Parameters:eventGridExpandChangeEvent

Fires when the user changes the Grid filter through the UI (more information and examples). You have to handle the event and filter the data yourself.

Parameters:eventGridFilterChangeEvent

Fires when the grouping of the Grid changes. You have to handle the event and group the data yourself (more information and examples).

Parameters:eventGridGroupChangeEvent

Fires when the user expands or collapses a group.

Fires when the user clicks the checkbox of a column header whose field matches selectedField (see example).

Fires when the user changes the values of the item. The event is not debounced. It fires on every onChange event of the input in the current EditCell (more information and examples).

Parameters:eventGridItemChangeEvent

Fires when the user presses a keyboard key.

Parameters:eventGridKeyDownEvent

Fires when the keyboard navigation position of the Grid changes.

Fires when the page of the Grid changes (see example). You have to handle the event and page the data yourself.

Parameters:eventGridPageChangeEvent

onRemove?

(event: GridRemoveEvent) => void

Fires when the user triggers a removal operation from a cell.

Parameters:eventGridRemoveEvent

Fires when the user clicks a row.

Parameters:eventGridRowClickEvent

Fires when the user double-clicks a row.

Parameters:eventGridRowClickEvent

Fires when the user pins, unpins, or moves a row between the pinned zones. Requires pinnable set to true.

Parameters:eventGridRowPinChangeEvent
Example:
vue
<Grid :pinnable="true" @rowpinchange="(e) => {
  pinnedTop = e.pinnedTopRows;
  pinnedBottom = e.pinnedBottomRows;
}" />

onSave?

(event: GridSaveEvent) => void

Fires when the user triggers a saving operation from a cell.

Parameters:eventGridSaveEvent

onScroll?

(event: any) => void

Fires when the user scrolls the Grid.

Parameters:eventany

Fires when the search descriptor of the Grid changes. You have to handle the event and search the data yourself.

Parameters:eventGridSearchChangeEvent

Fires when the user tries to select or deselect a row (see example).

Parameters:eventGridSelectionChangeEvent

Fires when the sorting of the Grid changes (see example). You have to handle the event and sort the data yourself.

Parameters:eventGridSortChangeEvent

Configures the pager of the Grid (see example).

The available options are:

  • buttonCount: Number—Sets the maximum number of numeric buttons before the buttons collapse.
  • info: Boolean—Toggles the information about the current page and the total number of records.
  • type: PagerType—Accepts the numeric (buttons with numbers)

and input (input for typing the page number) values.

  • pageSizes: Boolean or Array<number>—Shows a menu for selecting the page size.
  • previousNext: Boolean—Toggles the Previous and Next buttons.

pager?

string | boolean | Object | Function

Defines the custom rendering of the pager. Accepts a slot name, a render function, or a Vue component.

pageSize?

number

Defines the page size of the Grid pager (see example). The paging feature requires it.

pinnable?

boolean

Enables the row pinning feature. When false or not set, row pinning is off.

Example:
vue
<Grid :pinnable="true" :pinned-top-rows="pinnedTop" @rowpinchange="handlePinChange" />

The data items that the Grid pins to the bottom. Pinned rows stay visible while the body scrolls. Filtering and paging do not affect them. Requires pinnable set to true.

Example:
vue
<Grid :pinnable="true" :pinned-bottom-rows="[products[9]]" />

The data items that the Grid pins to the top. Pinned rows stay visible while the body scrolls. Filtering and paging do not affect them. Requires pinnable set to true.

Example:
vue
<Grid :pinnable="true" :pinned-top-rows="[products[0], products[1]]" />

When set to true, the user can reorder columns by dragging their header cells (see example).

resizable?

boolean

When set to true, the user can resize columns by dragging the edges (resize handles) of their header cells (see example).

rowClass?

Function

A function that returns a custom class for the row.

Defines the row height and makes all rows the same height (see example).

rowRender?

string | boolean | (h: any, defaultRendering: any, defaultSlots: any, props: any, listeners: any) => any

obsolete Will be removed in the next major release. Use the rows prop instead.

Defines a custom rendering for the rows.

Defines a set of custom row components that the Grid renders instead of the default rows.

Example:
vue
<Grid
  :rows="{
    pinnedData: CustomPinnedRow
  }"
/>

Enables the built-in row span feature of the Grid.

Example:
vue
<Grid :row-spannable="true" />

Defines the scroll mode of the Grid (see example).

The available options are:

  • none—Renders no scrollbar.
  • scrollable—The default scroll mode. It requires you to set the height option.
  • virtual—Displays no pager and renders only a part of the data (optimized rendering)

while the user scrolls the content.

Default:

'scrollable'

CompositeFilterDescriptor

The descriptor by which the Grid searches the data. Its first FilterDescriptor fills the GridSearchBox.

Example:
vue
<Grid :search="{ logic: 'and', filters: [{ field: 'name', operator: 'contains', value: 'test' }] }" />

searchFields?

string | SearchField[]

Defines the data fields that the GridSearchBox filters.

Example:
vue
<Grid :search-fields="['name', 'category']" />

select?

SelectDescriptor

The descriptor that defines the selected state of an item. Maps each item's dataItemKey value to its selection state. Set the value to true to select the whole row, or to an array of column indexes to select individual cells.

Example:
vue
<Grid :select="{ ['item-data-key-id']: true }" />

The selectable settings of the Grid.

Example:
vue
<Grid :selectable="{ enabled: true, mode: 'single' }" />

obsolete Will be removed in the next major release. Use selectable instead.

Specifies the name of the field that provides the selected state of the item.

Specifies whether the Grid shows its loader. Defaults to false.

size?

string

Configures the size of the Grid.

The available options are:

  • small
  • medium
Default:

'medium'

skip?

number

Defines the number of records that the pager skips (see example). The paging feature requires it.

sort?

SortDescriptor[]

The descriptors by which the Grid sorts the data. The Grid applies the sorting styles and buttons to the affected columns.

Enables sorting for the columns that have their field option set (see example).

Sets the style HTML attribute of the Grid.

take?

number

Alias of the pageSize property. If you set take, the Grid ignores pageSize.

Deprecated. Not needed any more.

Default:

0

total?

number

Defines the total number of data items in all pages (see example). The paging feature requires it.

Deprecated. Not needed any more.

Deprecated. Not needed any more. Use dataItemKey instead.