【问题标题】:set total items manually in kendo grid在剑道网格中手动设置总项目
【发布时间】:2014-03-06 16:58:29
【问题描述】:

我正在使用带有分页的剑道 ui 网格。我想设置本地数据(比如 10 个项目)并手动设置项目总数(比如 100 个),但找不到怎么做。

【问题讨论】:

    标签: kendo-ui kendo-grid


    【解决方案1】:

    我认为您应该可以通过在 DataSource 上设置 schema.total 来做到这一点。

    类似:

    var myData = [...];
    
    var determineTotal = function () {
        return myData.length; // or whatever value you want for the total.
    };
    
    var ds = new kendo.data.DataSource({
        data: myData,
        schema: {
            total: determineTotal
        }
    });
    
    $("#grid").kendoGrid({
        dataSource: ds
    });
    

    【讨论】:

      【解决方案2】:

      我们可以使用datasourceobject手动设置项目总数

        DataSource.total = function (){
                                 return 250
                           } 
      

      【讨论】:

        猜你喜欢
        • 2017-05-17
        • 2013-12-04
        • 1970-01-01
        • 2014-05-16
        • 2017-04-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多