-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(esf): add initial 'load on demand' POC #5448
- Loading branch information
1 parent
03daa14
commit 8cab60a
Showing
13 changed files
with
306 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/app/grid-esf-load-on-demand/grid-esf-load-on-demand.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<div class="wrapper"> | ||
<app-page-header title="Grid Excel Style Filtering - Load on demand"> | ||
Allows loading unique column values into the Excel Style Filtering on demand. | ||
</app-page-header> | ||
|
||
<div class="sample-content"> | ||
<div class="sample-column"> | ||
<div class="density-chooser"> | ||
<igx-buttongroup [values]="displayDensities" (onSelect)="selectDensity($event)"></igx-buttongroup> | ||
</div> | ||
<igx-grid #grid1 [data]="data" [displayDensity]="density" [showToolbar]="true" | ||
[columnHiding]="true" [allowFiltering]="true" [rowSelectable]="true" | ||
[filterMode]="'excelStyleFilter'" [width]="'900px'" | ||
[height]="'800px'" [style.zIndex]="'1'" | ||
|
||
[loadColumnValuesOnDemand]="loadColumnValues" | ||
[esfLoadingIndicatorTemplate]="loadTemplate" | ||
> | ||
|
||
<igx-column [field]="'ID'" [filterable]="true" [sortable]="true" [movable]="true" [dataType]="'string'"></igx-column> | ||
<igx-column [field]="'CompanyName'" [filterable]="true" [sortable]="true" [movable]="true" [dataType]="'string'"></igx-column> | ||
<igx-column [field]="'Employees'" [filterable]="true" [sortable]="true" [movable]="true" [dataType]="'number'"></igx-column> | ||
<igx-column [field]="'Contract'" [filterable]="true" [sortable]="true" [movable]="true" [dataType]="'boolean'"></igx-column> | ||
<igx-column [field]="'DateCreated'" [filterable]="true" [sortable]="true" [movable]="true" [dataType]="'date'"></igx-column> | ||
</igx-grid> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<ng-template #loadTemplate> | ||
Loading ... | ||
</ng-template> |
4 changes: 4 additions & 0 deletions
4
src/app/grid-esf-load-on-demand/grid-esf-load-on-demand.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.density-chooser { | ||
margin-bottom: 16px; | ||
max-width: 900px; | ||
} |
39 changes: 39 additions & 0 deletions
39
src/app/grid-esf-load-on-demand/grid-esf-load-on-demand.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Component, ViewChild, OnInit } from '@angular/core'; | ||
import { IgxGridComponent } from 'igniteui-angular'; | ||
import { SAMPLE_DATA } from '../shared/sample-data'; | ||
import { GridESFLoadOnDemandService } from './grid-esf-load-on-demand.service'; | ||
|
||
@Component({ | ||
selector: 'app-grid-esf-load-on-demand', | ||
templateUrl: './grid-esf-load-on-demand.component.html', | ||
styleUrls: ['./grid-esf-load-on-demand.component.scss'] | ||
}) | ||
export class GridEsfLoadOnDemandComponent implements OnInit { | ||
|
||
private esfService = new GridESFLoadOnDemandService(); | ||
|
||
public data: Array<any>; | ||
public density = 'comfortable'; | ||
public displayDensities; | ||
|
||
@ViewChild('grid1', { static: true }) | ||
public grid1: IgxGridComponent; | ||
|
||
public loadColumnValues = (columnField: string, done: (uniqueValues: string[]) => void) => { | ||
this.esfService.getData(columnField, uniqueValues => done(uniqueValues)); | ||
} | ||
|
||
public ngOnInit(): void { | ||
this.displayDensities = [ | ||
{ label: 'comfortable', selected: this.density === 'comfortable', togglable: true }, | ||
{ label: 'cosy', selected: this.density === 'cosy', togglable: true }, | ||
{ label: 'compact', selected: this.density === 'compact', togglable: true } | ||
]; | ||
|
||
this.data = SAMPLE_DATA.slice(0); | ||
} | ||
|
||
public selectDensity(event) { | ||
this.density = this.displayDensities[event.index].label; | ||
} | ||
} |
Oops, something went wrong.