I have the following switch that retrieves the group by dropdown selected value:
switch (groupValue) {
case "1":
groupField = { field : "GroupByEvent"};
break;
case "2":
groupField = { field: "GroupByHorse" };
break;
case "3":
groupField = { field: "ProductName" };
alert(groupField.field);
break;
case "4":
groupField = {field: "GroupByPaymentMethod"};
brak;
default:
groupField = { field: null };
break;
}
how can I change the kendo grid group by according to the case? (default means no grouping)
$("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "https://demos.telerik.com/kendo-ui/service/Products",
dataType: "jsonp"
}
},
pageSize: 5,
group: {
groupField ???
}
},