ContextMenu.groups.items
configurationSpecifies the items of the item.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
contextMenu: {
groups: [
{
text: "Custom Command",
icon: "calendar",
items: [
{ text: "Nested Custom Command", icon: "home", command: "NestedCustomCommand" }
]
},
'select'
]
},
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["NestedCustomCommand"] = kendo.ui.grid.GridCommand.extend({
exec: function(e) {
alert("Custom Command Executed")
}
});
</script>
Specifies the command of the item.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "productName" },
{ field: "category" }
],
dataSource: [
{ productName: "Tea", category: "Beverages" },
{ productName: "Coffee", category: "Beverages" }
],
groupable: true,
contextMenu: {
groups: [
{
text: "Advanced",
items: [
{
text: "Custom Group Action",
command: "CustomGroupCommand"
}
]
}
]
}
});
</script>
Specifies the icon of the item.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "productName" },
{ field: "category" }
],
dataSource: [
{ productName: "Tea", category: "Beverages" },
{ productName: "Coffee", category: "Beverages" }
],
groupable: true,
contextMenu: {
groups: [
{
text: "Group Actions",
items: [
{
text: "Collapse",
icon: "minus",
command: "CollapseCommand"
}
]
}
]
}
});
</script>
Specifies the name of the item.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "productName" },
{ field: "category" }
],
dataSource: [
{ productName: "Tea", category: "Beverages" },
{ productName: "Coffee", category: "Beverages" }
],
groupable: true,
contextMenu: {
groups: [
{
text: "Group Tools",
items: [
{
name: "subGroupAction",
text: "Sub Group Action",
command: "SubGroupCommand"
}
]
}
]
}
});
</script>
Specifies the text of the item.
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "productName" },
{ field: "category" }
],
dataSource: [
{ productName: "Tea", category: "Beverages" },
{ productName: "Coffee", category: "Beverages" }
],
groupable: true,
contextMenu: {
groups: [
{
text: "Group Operations",
items: [
{
text: "Expand All",
command: "ExpandAllCommand"
}
]
}
]
}
});
</script>