Kendo UI Grid Always Starts at Page 0

前端 未结 1 2028
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 12:39

I have a Kendo UI Grid and it\'s always starting at 0.

If I change the sort on a column then it goes to 1 and shows the other page numbers.

What am I doing w

相关标签:
1条回答
  • 2021-01-06 13:07

    Is your server returning the total number of records?

    If it is, define the schema as (assuming that total_size is where the server is returning the total number of records):

    schema   : {
        data: "data",
        total: "total_size",
        model: {
            ...
        }
    }
    

    If not, try adding to your schema a total function that gets it from the size of data array:

    schema   : {
        data: "data",
        total: function(data) {
            return data.data.length;
        },
        model: {
            ...
        }
    }
    
    0 讨论(0)
提交回复
热议问题