|
| 1 | +<div class="grid__wrapper"> |
| 2 | + <div class="button-container"> |
| 3 | + <button igxButton="raised" (click)="exportButtonHandler()">Export To Excel</button> |
| 4 | + Press the button to export the Grid as a .xlsx file. |
| 5 | + </div> |
| 6 | + |
| 7 | + <igx-grid [igxPreventDocumentScroll]="true" #grid [data]="data" [autoGenerate]="false" height="650px" width="100%"> |
| 8 | + <igx-column #col field="ProductID" header="Product ID" [headerClasses]="'prodId'"> |
| 9 | + </igx-column> |
| 10 | + <igx-column #col field="ProductName" header="Product Name" [headerClasses]="'prodId'" [hasSummary]="true"> |
| 11 | + <ng-template igxCell let-cell="cell" let-val> |
| 12 | + {{val}} |
| 13 | + </ng-template> |
| 14 | + <ng-template igxHeader let-col> |
| 15 | + <div class="header-text">{{col.field}}</div> |
| 16 | + <igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon> |
| 17 | + </ng-template> |
| 18 | + </igx-column> |
| 19 | + <igx-column #col field="UnitPrice" header="Price" [filterable]="false" [editable]="true" dataType="number" |
| 20 | + [hasSummary]="true"> |
| 21 | + <ng-template igxCell let-cell="cell" let-val let-row> |
| 22 | + ${{val}} |
| 23 | + </ng-template> |
| 24 | + <ng-template igxHeader let-col> |
| 25 | + <div class="header-text">{{col.field}}</div> |
| 26 | + <igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon> |
| 27 | + </ng-template> |
| 28 | + </igx-column> |
| 29 | + <igx-column #col field="UnitsInStock" header="Units In Stock" dataType="number" [editable]="true" |
| 30 | + [hasSummary]="false" [summaries]="mySummary"> |
| 31 | + <ng-template igxCell let-cell="cell" let-val let-row> |
| 32 | + {{val}} |
| 33 | + </ng-template> |
| 34 | + <ng-template igxHeader let-col> |
| 35 | + <div class="header-text">{{col.field}}</div> |
| 36 | + <igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon> |
| 37 | + </ng-template> |
| 38 | + </igx-column> |
| 39 | + <igx-column #col field="Discontinued" header="Discontinued" [hasSummary]="true" [dataType]="'boolean'"> |
| 40 | + <ng-template igxCell let-cell="cell" let-val> |
| 41 | + <img *ngIf="val" src="assets/images/grid/active.png" title="Continued" alt="Continued" /> |
| 42 | + <img *ngIf="!val" src="assets/images/grid/expired.png" title="Discontinued" alt="Discontinued" /> |
| 43 | + </ng-template> |
| 44 | + <ng-template igxHeader let-col> |
| 45 | + <div class="header-text">{{col.field}}</div> |
| 46 | + <igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon> |
| 47 | + </ng-template> |
| 48 | + </igx-column> |
| 49 | + <igx-column #col field="OrderDate" [dataType]="'date'" [hasSummary]="true"> |
| 50 | + <ng-template igxCell let-cell="cell" let-val let-row> |
| 51 | + {{ val | date: 'MMM d, yyyy' }} |
| 52 | + </ng-template> |
| 53 | + <ng-template igxHeader let-col> |
| 54 | + <div class="header-text">{{col.field}}</div> |
| 55 | + <igx-icon class="header-icon" style.color="{{ col.hasSummary ? '#e41c77' : '' }}" (click)="toggleSummary(col)">functions</igx-icon> |
| 56 | + </ng-template> |
| 57 | + </igx-column> |
| 58 | + </igx-grid> |
| 59 | +</div> |
0 commit comments