Kendo UI Angular 2 Grid Excel Export

2019-06-16 18:59发布

I'm trying to add excel export functionality to Kendo UI angular 2 grid, but getting an error while the angular 2 app loads:

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

Here is the code snippet I'm using:

<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 export functionality wasn't mentioned in the roadmap, so is it fair to assume it is already present? If so, how do I make the above snippet work? any help?

3条回答
爱情/是我丢掉的垃圾
2楼-- · 2019-06-16 19:41

Currently, the Kendo UI Grid for Angular 2 does not support Excel export. The toolbar is set via ToolbarComponent, which currently projects the content using ng-content. You can see all this in the docs

查看更多
混吃等死
3楼-- · 2019-06-16 19:51

Excel Export is now an official feature of the Kendo UI Grid. It can also be used on its own, as a non-visual component for generating XLSX files.

查看更多
Anthone
4楼-- · 2019-06-16 19:59

Excel export feature has been added (use the kendoGridExcelCommand) and an example can be seen here.

查看更多
登录 后发表回答