I have a large grid (to support filter functions) and I have editable: "popup" set. This is fine when I have a 20 row set, but it doesn't finish in a tolerable length of time with a 60,000 row set.
I have not yet written the writeback functions to update the database. This is just updating the grid.
Any advice would be appreciated.
Here is the code:
@{
ViewBag.Title = "Casebook Files";
}
<h2>Casebook Files</h2>
<script src="~/Scripts/jquery-3.6.0.min.js"></script>
<link href="https://kendo.cdn.telerik.com/2021.1.330/styles/kendo.common.min.css" rel="stylesheet" />
<link href="https://kendo.cdn.telerik.com/2021.1.330/styles/kendo.default.min.css" rel="stylesheet" />
@*<script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>*@
<script src="https://kendo.cdn.telerik.com/2021.1.330/js/kendo.all.min.js"></script>
<div id="kendoGrid">
</div>
<script>
var caseBookDatasource;
$(function () {
$("#kendoVersion").text(kendo.version);
var casebooks = getCaseBooks();
});
function getCaseBooks() {
$.ajax({
//url: "/Home/GetCaseBooks"
url:"/Home/GetNewtonCaseBooks"
}).done(function (rows) {
var datarows = JSON.parse(rows);
buildCasebookDatasource(datarows)
createGrid();
});
}
function buildCasebookDatasource(rows) {
caseBookDatasource = new kendo.data.DataSource({
data: rows,
schema: {
model: {
fields: {
recordId: { type: "number" },
caseNumber: { type: "string" },
caseName: { type: "string" },
serviceReqDate: { type: "date" },
srProg: { type: "string" },
srUnit: { type: "string" },
boxNumber: { type: "number" },
destructDate: { type: "date" },
notes: { type: "string" },
otherNames: { type: "string" },
initials: { type: "string" },
xRef1: { type: "string" },
xRef2: { type: "string" },
xRef3: { type: "string" },
xRef4: { type: "string" }
}
}
},
pageSize: 20,
sort: {
field: "caseNumber",
dir: "asc"
}
});
}
function createGrid() {
$("#kendoGrid").kendoGrid({
dataSource: caseBookDatasource,
height: 750,
pageable: true,
sortable: true,
filterable: true,
scrollable: "virtual",
columns: [
{
field: "recordId"
},
{
field: "caseNumber",
title: "Case #",
width: 100
},
{
field: "caseName",
title: "Name",
width: 200
},
{
field: "serviceReqDate",
title: "Received",
template: "#= kendo.toString(kendo.parseDate(serviceReqDate, 'yyyy-MM-dd'), 'MM/dd/yyyy') #",
width: 120
},
{
field: "srProg",
title: "Program",
width: 50
},
{
field: "srUnit",
title: "Unit",
width: 50
},
{
field: "boxNumber",
title: "Box",
width: 50
},
{
field: "destructDate",
title: "Destroyed",
template: "#= kendo.toString(kendo.parseDate(destructDate, 'yyyy-MM-dd'), 'MM/dd/yyyy') #",
width: 120
},
{
field: "notes",
title: "Notes",
width: 200
},
{
field: "otherNames",
title: "Other Names",
width: 200
},
{
field: "initials",
title: "Initials",
width: 50
},
{
field: "xRef1",
title: "XRef1",
width: 50
},
{
field: "xRef2",
title: "XRef2",
width: 50
},
{
field: "xRef3",
title: "XRef3",
width: 50
},
{
field: "xRef4",
title: "XRef4",
width: 50
},
{command: "edit"}
],
editable: "popup",
toolbar:["create","cancel", "save"]
});
}
</script>