contextMenu.head Array
Configures the items of the ContextMenu for the table head element. Those are some valid predifined tools: "separator", "create", "edit", "destroy", "select", "copySelection",."copySelectionNoHeaders", "reorderRow", "exportPDF", "exportExcel", "sortAsc", "sortDesc".
You can also specify a custom item and accosiate it with a command.
Example
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
contextMenu: {
head: [
"sortAsc",
"sortDesc",
"exportExcel",
{ name: "MyCustomCommand", text: "My Custom Command", icon: "gear", command: "CustomCommand" }
]
// You can also concat to the default tools
// head: kendo.ui.grid.defaultHeadContextMenu.concat([
// { name: "MyCustomCommand", text: "My Custom Command", icon: "gear", command: "CustomCommand" }
// ])
},
editable: true,
sortable: true,
draggable: true,
reorderable: true,
dataSource: new kendo.data.DataSource({
schema: {
model: {
id: "foo",
fields: {
name: "name",
foo: "foo",
},
},
},
data: [
{ foo: "bar", name: "tom" },
{ foo: "baz", name: "jerry" },
],
}),
});
kendo.ui.grid.commands["CustomCommand"] = kendo.ui.grid.GridCommand.extend({
exec: function() {
var that = this,
grid = that.grid;
grid.saveAsPDF();
}
});
</script>