I have a grid that has 2 checkboxes in it. Before I send the data to the controller I am looping through the rows to get certain values. I have no issues getting the grid data source and iterating through the rows. I am however running into an issue finding out if the checkboxes are checked or not.
Grid
$("#multipleUploadDetailGrid").kendoGrid({
dataSource: {
//data: self.MultipleUploadDetails,
schema: {
model: {
id: "Id",
fields: {
DocumentType: { editable: true, field: "DocumentType" },
FileName: { editable: false, type: "string" },
FileSize: { editable: false, type: "string" },
IsConf: { editable: true, type: "boolean" },
IsTs: { editable: true, type: "boolean" },
}
}
}
},
pageable: false,
selectable: false,
refresh: false,
editable: true,
resizable: true,
reorderable: true,
noRecords: { template: "<div class='k-grid-norecords-template' style='margin:0 auto;position:static;'>No Files Uploaded</div>" },
sortable: {
mode: "multiple",
allowUnsort: true
},
columns: [
{ field: "FileName", title: "Name", width: 150, sortable: true },
{ field: "FileSize", title: "Size", width: 150, sortable: true },
{ field: "DocumentType", title: "Document Type", width: 225, editor: docTypeDropDownEditor, template: "#if (!!data.DocumentType){#<span>#:oir.Utilities.checkNull(DocumentType.Name)#</span>#}else{#<span>No Doc Type</span>#}#"},
{
field: "IsConf", title: "Confidential",
template: "<input name='IsConf' type='checkbox' />", width: 40, sortable: true, headerAttributes: { style: "text-align:center" }, attributes: { style: "text-align:center;" }
},
{ field: "IsTs", title: "Trade Secret", template: "<input name='IsTs' type='checkbox' />", width: 40, sortable: true, headerAttributes: { style: "text-align:center" }, attributes: { style: "text-align:center;" } },
],
});
Code to iterate through datasource.
var grid = $("#multipleUploadDetailGrid").data("kendoGrid");
var ds = grid.dataSource.view();
var dslength = ds.length;
if (dslength > 0) {
for (var i = 0; i < dslength; i++) {
var currRow = ds[i];
//trying to get checkbox value here.
}
}