Grid update VERY slow with 60000 rows

1 Answer 564 Views
Data Source Grid
Glenn
Top achievements
Rank 1
Glenn asked on 04 May 2021, 06:35 PM

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>

1 Answer, 1 is accepted

Sort by
0
Veselin Tsvetanov
Telerik team
answered on 07 May 2021, 12:56 PM

Hi Glenn,

In order to improve performance when dealing with a massive amount of data in a Grid, you should consider virtualization of remote data. Here is a Grid Demo implementing such a scenario:

https://demos.telerik.com/kendo-ui/grid/virtualization-remote-data

Otherwise, loading the full data on the client will result in delays as observed at your end.

Regards,
Veselin Tsvetanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
Data Source Grid
Asked by
Glenn
Top achievements
Rank 1
Answers by
Veselin Tsvetanov
Telerik team
Share this question
or