The Kendo MobileSwitch can be implemented as a column editor to a boolean model field. Here a ClientTemplate can be used supplying an input of type checkbox. Later in the DataBound event handler, the Switch will be initialized.
.Events(ev => ev.DataBound("onDataBound"))
functiononDataBound(e) {
this.tbody.find(".customClass").kendoMobileSwitch({
change: function (e) {
var grid = $("#grid").getKendoGrid();
var dataItem = grid.dataItem(this.element.closest("tr"));
dataItem.set("Discontinued", e.checked);
}
});
}
For your convenience, I am attaching a small project demonstrating the above. Let me know if you have any questions.
Regards,
Nikolay
Progress Telerik
Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic. Our thoughts here at Progress are with those affected by the outbreak.