contextMenu.body Array

Configures the items of the ContextMenu for the table body 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: {
            body: [
                "exportPDF",
                "exportExcel",
                { name: "MyCustomCommand", text: "My Custom Command", icon: "gear", command: "CustomCommand" }
            ]
            // You can also concat to the default tools
            // body: kendo.ui.grid.defaultBodyContextMenu.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>
In this article