This is a migrated thread and some comments may be shown as answers.

Kendo Grid arrow paging is not working properly after adding new record, while number paging is working properly

1 Answer 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
vinod
Top achievements
Rank 1
vinod asked on 03 Mar 2014, 10:05 AM
function ShowDiagnostics() {
    diagnosticDataSource = new kendo.data.DataSource({
        transport: {
            read: {
                url: "/DiagnosticBuilder/GetDiagnosticJSON",
                dataType: "json",
            }
        },
        pageSize: 10
    });
    var columns = [
        { title: "DiagnosticBuilderID", field: "DiagnosticBuilderID", hidden: true, type: "number", filterable: false },
        { title: "Template Name", field: "TemplateName", hidden: false, type: "string", filterable: false },
        { title: "Target", field: "Target", hidden: false, type: "string", filterable: false },
        { title: "No. of Questions", field: "NumberOfQuestions", hidden: false, type: "number", filterable: false },
        { title: "Action", field: "", hidden: false, type: "string", filterable: false }
        
    ];

    diagnosticGrid = $("#tblDiagnostics").kendoGridAcademy({
        columns: columns,
        dataSource: diagnosticDataSource,
        rowTemplate: kendo.template($("#diagnosticRowTemplate").html()),
        filterable: true,
        pageable: true,
    });
    $(diagnosticGrid).refresh();
}

1 Answer, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 05 Mar 2014, 09:07 AM
Hello Vinod,

Could you please elaborate on your issues? Provide screenshot or screencast so we can get a better idea of your case.

Basically if using serverPaging of the dataSource no matter how many new records you create, they will look like added to the current page. This can be changed by performing read after creating.

onRequestEnd(e) {
    if( e.type == "create" ) {
        this.read();
    }
}

However you should not experience such issues if using client paging like demonstrated here:

http://jsbin.com/yedivuri/1/edit

Kind Regards,
Petur Subev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
vinod
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Share this question
or