代码之家  ›  专栏  ›  技术社区  ›  Chanaka Amarasinghe

如何下载带有绑定字段列的剑道网格excel表?

  •  0
  • Chanaka Amarasinghe  · 技术社区  · 6 年前

      <kendo-grid-column title="{{ 'MPG/PartNumber/Size' | translate}}" width="250">
    <ng-template kendoGridCellTemplate let-dataItem>
      <span>{{ dataItem.manufactureCode }}</span>
      <span>{{ dataItem.partNo }}</span>
      <span>{{ dataItem.size }}</span>
    </ng-template>
    <ng-template kendoGridEditTemplate let-dataItem="dataItem">
      <input [formControl]="formGroup.get('manufactureCode')" class="k-textbox boxtext">
      <input [formControl]="formGroup.get('partNo')" class="k-textbox boxtext">
      <input [formControl]="formGroup.get('size')" class="k-textbox boxtext">
    </ng-template></kendo-grid-column>
    
      <kendo-grid-column field="name" title="{{ 'Description' | translate}}">
    <ng-template kendoGridEditTemplate let-column="column" let-formGroup="formGroup" let-isNew="isNew">
      <input #input class="k-textbox" [formControl]="formGroup.get(column.field)">
    </ng-template></kendo-grid-column>
    
      <kendo-grid-column field="upc" title="{{ 'UPC' | translate}}" width="150">
    <ng-template kendoGridEditTemplate let-column="column" let-formGroup="formGroup" let-isNew="isNew">
      <input #input class="k-textbox" [formControl]="formGroup.get(column.field)">
    </ng-template></kendo-grid-column>
    
    <kendo-grid-excel fileName="Products.xlsx" [fetchData]="allData"></kendo-grid-excel>
    
    1 回复  |  直到 6 年前
        1
  •  0
  •   Chanaka Amarasinghe    6 年前

    这就是路

      <kendo-grid-excel fileName="Products.xlsx">
    <kendo-excelexport-column field="manufactureCode" title="MFG">
    </kendo-excelexport-column>
    <kendo-excelexport-column field="partNo" title="Part">
    </kendo-excelexport-column>
    <kendo-excelexport-column field="size" title="Size">
    </kendo-excelexport-column>
    <kendo-excelexport-column field="name" title="Description">
    </kendo-excelexport-column>
    <kendo-excelexport-column field="upc" title="UPC">
    </kendo-excelexport-column>