如何绑定所有数据,而不仅仅是可见页面的数据

How to hold all the data bound, not just the data of the visible page

首先,很抱歉我的英语水平不够。

我的网格在一页上显示 20 行。要使用 Excel 导出客户端模板,我使用了在论坛中找到的以下来源。

function excelExportWithTemplates(e) {
    var sheet = e.workbook.sheets[0];
    var colTemplates = [];
    var data = this.dataSource.view();

    for (var i = 0; i < this.columns.length; i++) {
        if (this.columns[i].template) {
            colTemplates.push(kendo.template(this.columns[i].template));
        } else {
            colTemplates.push(null); 
        }
    }

    for (var i = 0; i < colTemplates.length; i++) {
        for (var j = 0; j < data.length; j++) {
            if (colTemplates[i] != null) {
                sheet.rows[j + 1].cells[i].value = colTemplates[i](data[j]);
            }
        }
    }      
}

比如我一共有100条数据,只有20条数据,一个view的大小, 剩余部分不能申请。

不是这个意思 Excel导出效果不佳,我的意思是 Excel使用 ClientTemplate 导出仅能处理 20 行。 (我的浏览页数)

为此,添加 data.Source.View 我试着把它改成总计 总计只是数数, 尚未进行任何转换。

转换所有数据 我应该把 .view 变成什么?

改为view() method will return only the rendered data on the viewport. Use the data()方法,它将return所有dataSource的数据:

var data = this.dataSource.data();