Skip to content

Commit f8db2f8

Browse files
committed
fix(pdf demo): removing the hallucinated input groups
1 parent b6a4741 commit f8db2f8

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

src/app/app.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,11 @@ export class AppComponent implements OnInit {
421421
icon: 'view_column',
422422
name: 'Grid Export'
423423
},
424+
{
425+
link: '/gridPdfExport',
426+
icon: 'view_column',
427+
name: 'Grid PDF Export'
428+
},
424429
{
425430
link: '/gridSearch',
426431
icon: 'view_column',

src/app/grid-pdf-export/grid-pdf-export.sample.html

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ <h2 class="sample-title">PDF Export Service Demo</h2>
88
<!-- Export Configuration Panel -->
99
<div class="config-panel">
1010
<h3>Export Options Configuration</h3>
11-
11+
1212
<div class="config-row">
1313
<igx-input-group>
1414
<label igxLabel>File Name</label>
@@ -17,24 +17,20 @@ <h3>Export Options Configuration</h3>
1717
</div>
1818

1919
<div class="config-row">
20-
<igx-input-group>
20+
<igx-select [(ngModel)]="pageOrientation">
2121
<label igxLabel>Page Orientation</label>
22-
<igx-select [(ngModel)]="pageOrientation">
23-
<igx-select-item value="portrait">Portrait</igx-select-item>
24-
<igx-select-item value="landscape">Landscape</igx-select-item>
25-
</igx-select>
26-
</igx-input-group>
22+
<igx-select-item value="portrait">Portrait</igx-select-item>
23+
<igx-select-item value="landscape">Landscape</igx-select-item>
24+
</igx-select>
2725
</div>
2826

2927
<div class="config-row">
30-
<igx-input-group>
28+
<igx-select [(ngModel)]="pageSize">
3129
<label igxLabel>Page Size</label>
32-
<igx-select [(ngModel)]="pageSize">
33-
@for (size of pageSizes; track size) {
34-
<igx-select-item [value]="size">{{ size.toUpperCase() }}</igx-select-item>
35-
}
36-
</igx-select>
37-
</igx-input-group>
30+
@for (size of pageSizes; track size) {
31+
<igx-select-item [value]="size">{{ size.toUpperCase() }}</igx-select-item>
32+
}
33+
</igx-select>
3834
</div>
3935

4036
<div class="config-row">
@@ -57,7 +53,7 @@ <h3>Regular Grid</h3>
5753
Export to PDF
5854
</button>
5955
</div>
60-
56+
6157
<igx-grid #grid1 [data]="gridData" [autoGenerate]="false" height="400px" width="100%">
6258
<igx-column field="ID" header="ID" [width]="'80px'"></igx-column>
6359
<igx-column field="Name" header="Product Name" [width]="'200px'"></igx-column>
@@ -76,8 +72,8 @@ <h3>Tree Grid (with Hierarchy)</h3>
7672
Export to PDF
7773
</button>
7874
</div>
79-
80-
<igx-tree-grid #treeGrid [data]="treeGridData" [autoGenerate]="false"
75+
76+
<igx-tree-grid #treeGrid [data]="treeGridData" [autoGenerate]="false"
8177
primaryKey="ID" foreignKey="ParentID" height="400px" width="100%">
8278
<igx-column field="ID" header="ID" [width]="'100px'"></igx-column>
8379
<igx-column field="Name" header="Department Name" [width]="'300px'"></igx-column>
@@ -93,13 +89,13 @@ <h3>Hierarchical Grid</h3>
9389
Export to PDF
9490
</button>
9591
</div>
96-
97-
<igx-hierarchical-grid #hierarchicalGrid [data]="hierarchicalGridData"
92+
93+
<igx-hierarchical-grid #hierarchicalGrid [data]="hierarchicalGridData"
9894
[autoGenerate]="false" height="400px" width="100%">
9995
<igx-column field="ID" header="ID" [width]="'80px'"></igx-column>
10096
<igx-column field="CompanyName" header="Company" [width]="'250px'"></igx-column>
10197
<igx-column field="Revenue" header="Revenue" dataType="currency" [width]="'150px'"></igx-column>
102-
98+
10399
<igx-row-island [key]="'Employees'" [autoGenerate]="false">
104100
<igx-column field="ID" header="Employee ID" [width]="'120px'"></igx-column>
105101
<igx-column field="Name" header="Name" [width]="'200px'"></igx-column>
@@ -117,7 +113,7 @@ <h4>How to Use:</h4>
117113
<li>The PDF will be downloaded with your configured settings</li>
118114
<li>Tree and Hierarchical grids will show indentation in the exported PDF</li>
119115
</ol>
120-
116+
121117
<h4>Key Features:</h4>
122118
<ul>
123119
<li><strong>Direct API Usage:</strong> Uses IgxPdfExporterService.export() method directly</li>

src/app/grid-pdf-export/grid-pdf-export.sample.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { Component, ViewChild } from '@angular/core';
1+
import { Component, ViewChild, inject } from '@angular/core';
22
import { FormsModule } from '@angular/forms';
3-
import {
4-
IgxGridComponent,
5-
IgxColumnComponent,
6-
IgxPdfExporterService,
3+
import {
4+
IgxGridComponent,
5+
IgxColumnComponent,
6+
IgxPdfExporterService,
77
IgxPdfExporterOptions,
88
IgxTreeGridComponent,
99
IgxHierarchicalGridComponent,
@@ -39,6 +39,8 @@ import {
3939
providers: [IgxPdfExporterService]
4040
})
4141
export class GridPdfExportSampleComponent {
42+
private pdfExporter = inject(IgxPdfExporterService);
43+
4244
@ViewChild('grid1', { static: true })
4345
public grid1: IgxGridComponent;
4446

@@ -100,11 +102,8 @@ export class GridPdfExportSampleComponent {
100102
public pageSize = 'a4';
101103
public showTableBorders = true;
102104
public fontSize = 10;
103-
104105
public pageSizes = ['a3', 'a4', 'a5', 'letter', 'legal'];
105106

106-
constructor(private pdfExporter: IgxPdfExporterService) {}
107-
108107
public exportGrid() {
109108
const options = this.createExportOptions();
110109
this.pdfExporter.export(this.grid1, options);

0 commit comments

Comments
 (0)