This is a migrated thread and some comments may be shown as answers.
Kendo Pager Breaking on 11th Page
1 Answer 7 Views
This is a migrated thread and some comments may be shown as answers.
don
Top achievements
Rank 1
don asked on 19 Jul 2013, 02:11 PM
I have the following method that sets up a kendo datasource and ties it to a pager and listview. As you'll see in the attached code, the pager itself is pretty bare bones, tie it to the datasource. The datasource sets the page size (10) and turns on serverside paging. Everything works great, until I try to page more than a certain, unknown, number of records. For example, with a page size of 10, I can break the pager by return 101 records. That initially led me to think maybe it was the idea of rendering more than 10 pages. Unfortunately, a page size of 100, and 1000 records also breaks. Any insight to what I am overlooking would be greatly appreciated. Thanks in advance.

var dsOpts = {
    transport: {
        read: {
            url: function() {
                if(displayMode == "items")
                    return "Coverage/GetFolderItemsByPage";
                else if(displayMode == "filter")
                    return "Coverage/GetFilterItemsByPage";
            },
            dataType: "json",
            data: function () {
                if (displayMode == "items") {
                    return {
                        folderId: function () { return $("#treeview").data("kendoTreeView").dataItem("#treeview_tv_active").FolderId },
                        sourceTypeFilter: function () {
                            if ($("#optSourceType").length > 0)
                                return $("#optSourceType").find(".k-state-selected").attr("value");
                            else
                                return "";
                        }
                    };
                } else if (displayMode == "filter") {
                    return getFilterItems();
                }
            }
 
        }
    },
    serverPaging: true,
    schema: {
        data: "MediaItems",
        total: function (response) { return response.Total; },
        model: ItemModel,
        id: "ItemId"
    },
    pageSize: 100,
    requestStart: function (e) {
        kendo.ui.progress($(".image-preview-list"), false);
    },
    requestEnd: function (e) {
        resizeSliders();
        if (displayMode == "items") {
            if (typeof $("#treeview").data("kendoTreeView").dataItem("#treeview_tv_active") != 'undefined')
                $("#hdrFolderName").html("Now Displaying Folder: " + $("#treeview").data("kendoTreeView").dataItem("#treeview_tv_active").Name);
        } else {
            $("#hdrFolderName").html("Now Displaying Filtered Results");
        }
 
 
    }
};
 
MediaItems = new kendo.data.DataSource(dsOpts);
 
$("#divPaging").kendoPager({
    dataSource: MediaItems
});

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 23 Jul 2013, 01:12 PM
Hello Don,

Your code looks OK. I am not sure where exactly the problem comes from.
Could you please specify how exactly the pager "breaks"? Are there any JavaScript errors?

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