Toolbar.items
configurationAn array collection of items to be rendered in the toolbar. Each item will be treated as the list of commands displayed in the grid's Toolbar. Commands can be custom or built-in ("cancel", "create", "save", "excel", "pdf").
-
The "cancel" built-in command reverts any data changes done by the end user.
-
The "create" command adds an empty data item to the grid.
-
The "canceledit" command cancels the changes to the dataItem that is being currenly edited.
-
The "update" command save the changes to the dataItem that is being currenly edited.
-
The "destroy" command removes the selected item. To work as expected, the grid should be selectable. If multiple selection is enabled, the item which will be remoed is the last selected one.
-
The "edit" command triggers the edit state of currently selected item. To work as expected, the grid should be selectable. If multiple selection is enabled, the item which will be edited is the last selected one.
-
The "save" command persists any data changes done by the end user. When executed fires
saveChangesgrid event. -
The "excel" command exports the grid data in MS Excel format. Fires
excelExportgrid event. -
The "pdf" command exports the grid data in PDF format. Fires
pdfExportgrid event. -
The "search" command renders the built-in search panel for the grid.
-
The "columns" command renders a global column menu.
-
The "columns" command generates a button to open a global columns menu.
-
The "paste" command enables the user to switch between the "replace" and "insert" modes of the paste functionality. The
allowPasteconfiguration must enabled for the dropdown to appear. -
The "sort" command enables the user to use the sorting functionallity of the grid.
-
The "filter" command enables the user to use the filtering functionallity of the grid.
-
The "group" command enables the user to use the grouping functionallity of the grid.
-
The "columnChooser" command enables the user to change the visibillity of the grid's columns.
-
The "selectAll" command enables the user to select all rows if the grid is
selectable. -
The "aiAssistant" command renders the AI assistant tool in the toolbar.
-
The "smartBox" command renders the smart search box tool in the toolbar.
toolbar.items.clearButton
booleanShow a clear all sorts or clear all filters button.
Only applicable for Sort,Filter, and Group tools.
toolbar.items.iconClass
StringThe class for the web font icon of the button that will be rendered in the toolbar.
Grid commands are rendered as anchors (
<a>) with aspaninside. The icon for the button depends on the iconClass which is rendered as a class for the inner span. Built-in commands have a predefined iconClass value.
toolbar.items.name
StringThe name of the toolbar command. Either a built-in ("cancel", "create", "save", "excel", "pdf") or custom. The name is reflected in one of the CSS classes, which is applied to the button - k-grid-name.
This class can be used to obtain reference to the button after Grid initialization and attach click handlers.
toolbar.items.template
String|FunctionThe template which renders the command. By default renders a button.
Check Toolbar template for a live demo.
toolbar.items.text
StringThe text displayed by the command button. If not set the name option would be used as the button text instead.