toolbar.items.nameString
The 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.
Example - configure toolbar item name
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
],
toolbar: {
items: [
{ name: "myCustomCommand", text: "My Command" }
]
}
});
// Access button by CSS class derived from name
$(".k-grid-myCustomCommand").click(function() {
alert("Custom command clicked!");
});
</script>
In this article