Toolbar
configurationIf a String value is assigned to the toolbar configuration option, it will be treated as a single string template for the whole grid Toolbar,
and the string value will be passed as an argument to a kendo.template() function.
If a Function value is assigned (it may be a kendo.template() function call or a generic function reference), then the return value of the function will be used to render the Grid Toolbar contents.
If the grid is instantiated with MVVM, The template passed will not be bound to the grid view model context. You may bind the toolbar element manually afterwards, using
kendo.bind(gridWidgetInstance.element.find("k-grid-toolbar"))
If an Array value is assigned, it 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 "save" command persists any data changes done by the end user. When executed fires saveChanges grid event.
The "excel" command exports the grid data in MS Excel format. Fires excelExport grid event.
The "pdf" command exports the grid data in PDF format. Fires pdfExport grid 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 allowPaste configuration 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 "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. Requires enabled checkbox selection and multiple row selection.
The "aiAssistant" command renders the AI assistant tool in the toolbar.
The "smartBox" command renders the smart search box tool in the toolbar.
- If an
Objectvalue is assigned, it will propagate these properties to the underlying Toolbar:items- an array of commands as explained aboveoverflow- an object that configures the overflow behavior of the toolbar. The same asToolbar.overflowproperty
toolbar
String|Function|Array|Objecttoolbar.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.
An 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.name
StringThe name of the toolbar command. Either a built-in ("cancel", "create", "save", "excel", "pdf") or custom. When a custom command is added 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.overflow
ObjectSpecifies Toolbar.overflow configuration for the toolbar.
toolbar.showInactiveTools
BooleanIf set to true, the toolbar will show the inactive tools in a disabled state. Otherwise the tools will be hidden.
toolbar.template
String|FunctionThe template which renders the command. By default renders a button.
toolbar.text
StringThe text displayed by the command button. If not set the name option would be used as the button text instead.