【问题标题】:Kendo UI Angular 2 Grid Excel ExportKendo UI Angular 2 网格 Excel 导出
【发布时间】:2017-04-16 02:02:37
【问题描述】:

我正在尝试将 excel 导出功能添加到 Kendo UI angular 2 网格,但在加载 angular 2 应用程序时出现错误:

Can't bind to 'toolbar' since it isn't a known property of 'kendo-grid'.

这是我正在使用的代码 sn-p:

<kendo-grid [data]="gridView" [height]="700" [pageSize]="pageSize"
                        [toolbar]="['excel']" 
                        [excel]="{fileName: 'Reprocessingdetails.xlsx'}"
                        [skip]="skip"
                          [pageable]="{
                            info: true,
                            type: 'input',
                            pageSizes: false,
                            previousNext: true
                          }"
                          [scrollable]="'none'"
                          (pageChange)="pageChange($event)"
                          [sortable]="{ mode: 'single', allowUnsort: true }"
                          [sort]="sort"
                          (sortChange)="reprocessingResultsSortChange($event)"
                        >
                <kendo-grid-column field="isSelected" title="Select">
                    <template kendoCellTemplate let-dataItem>
                        <input type="checkbox" [(ngModel)]="dataItem.isSelected" />
                    </template>
                </kendo-grid-column>
                <kendo-grid-column field="reprocessingType" title="Reprocessing Type">
                </kendo-grid-column>


            </kendo-grid>

路线图中未提及 Excel 导出功能,因此假设它已经存在是否公平?如果是这样,我如何使上述 sn-p 工作?有什么帮助吗?

【问题讨论】:

    标签: angular kendo-ui-angular2


    【解决方案1】:

    Excel Export 现在是 Kendo UI Grid 的官方功能。它也可以单独使用,如a non-visual component 用于生成 XLSX 文件。

    【讨论】:

      【解决方案2】:

      目前,Angular 2 的 Kendo UI Grid 不支持 Excel 导出。工具栏通过ToolbarComponent 设置,当前使用ng-content 投影内容。你可以在docs看到这一切

      【讨论】:

      • 嗨@knikolov,感谢您的确认。这会包含在 2017 年 1 月的更新中吗?我目前正在从事一个迁移项目,该项目需要从以前的基于 Silverlight 的解决方案中继承这些功能。 (列菜单(过滤和列选择器)和导出功能)
      • 不打算在 1 月发布。
      • 所有提到的功能都暂定于 2017 年 5 月完成。我们经常发布,所以请留意这里的更新日志telerik.com/kendo-angular-ui/components/grid/changelog
      【解决方案3】:

      已添加 Excel 导出功能(使用 kendoGridExcelCommand),示例可见here

      【讨论】:

        猜你喜欢
        • 2015-02-22
        • 2018-04-26
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多