+ [height]="'700px'" [rowSelectable]='true' [primaryKey]="'ID'" (onFocusChange)="changeFocus($event)">
@@ -24,5 +24,5 @@
-
+ Current Display Density: {{displayDensityOptions.displayDensity}}
diff --git a/src/app/grid-groupby/grid-groupby.sample.ts b/src/app/grid-groupby/grid-groupby.sample.ts
index f057d0b9a53..627be7f271c 100644
--- a/src/app/grid-groupby/grid-groupby.sample.ts
+++ b/src/app/grid-groupby/grid-groupby.sample.ts
@@ -1,24 +1,24 @@
-import { Component, Injectable, ViewChild, OnInit } from '@angular/core';
+import { Component, Injectable, ViewChild, OnInit, Inject } from '@angular/core';
-import { IgxGridComponent, SortingDirection, ISortingExpression, IGridFocusChangeEventArgs } from 'igniteui-angular';
-import { DisplayDensity } from 'projects/igniteui-angular/src/lib/core/displayDensity';
+import { IgxGridComponent, SortingDirection, ISortingExpression, IgxInputGroupComponent } from 'igniteui-angular';
+import { IGridFocusChangeEventArgs } from 'projects/igniteui-angular/src/lib/grids/grid/grid.component';
+import { DisplayDensityToken, DisplayDensity, IDisplayDensityOptions } from 'projects/igniteui-angular/src/lib/core/displayDensity';
import { detectChanges } from '@angular/core/src/render3';
@Component({
- providers: [],
+ providers: [{ provide: DisplayDensityToken, useValue: { displayDensity: DisplayDensity.compact} }],
selector: 'app-grid-sample',
styleUrls: ['grid-groupby.sample.css'],
templateUrl: 'grid-groupby.sample.html'
})
-
export class GridGroupBySampleComponent implements OnInit {
@ViewChild('grid1') public grid1: IgxGridComponent;
public data: Array;
public hideGroupedColumns = false;
public columns: Array;
public groupingExpressions: Array;
+ constructor(@Inject(DisplayDensityToken) public displayDensityOptions: IDisplayDensityOptions) {}
public ngOnInit(): void {
-
this.columns = [
{ field: 'ID', width: 100, hidden: true },
{ field: 'CompanyName', width: 300, groupable: true },
@@ -32,12 +32,6 @@ export class GridGroupBySampleComponent implements OnInit {
{ field: 'Phone', width: 150, groupable: true },
{ field: 'Fax', width: 150, groupable: true }
];
- this.groupingExpressions = [
- {
- fieldName: 'CompanyName',
- dir: SortingDirection.Asc
- }
- ];
this.hideGroupedColumns = true;
/* tslint:disable */
@@ -94,10 +88,10 @@ export class GridGroupBySampleComponent implements OnInit {
this.grid1.hideGroupedColumns = !event.checked;
}
toggleDensity() {
- switch (this._density) {
- case DisplayDensity.comfortable: this.density = DisplayDensity.cosy; break;
- case DisplayDensity.cosy: this.density = DisplayDensity.compact; break;
- case DisplayDensity.compact: this.density = DisplayDensity.comfortable; break;
+ switch (this.displayDensityOptions.displayDensity ) {
+ case DisplayDensity.comfortable: this.displayDensityOptions.displayDensity = DisplayDensity.compact; break;
+ case DisplayDensity.compact: this.displayDensityOptions.displayDensity = DisplayDensity.cosy; break;
+ case DisplayDensity.cosy: this.displayDensityOptions.displayDensity = DisplayDensity.comfortable; break;
}
}
getRowsList() {
diff --git a/src/app/input-group/input-group-child.sample.ts b/src/app/input-group/input-group-child.sample.ts
index abfc344cb16..defd45c4f3a 100644
--- a/src/app/input-group/input-group-child.sample.ts
+++ b/src/app/input-group/input-group-child.sample.ts
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
-import { DisplayDensityToken, DisplayDensity, IDisplayDensity } from 'projects/igniteui-angular/src/lib/core/displayDensity';
+import { DisplayDensityToken, DisplayDensity, IDisplayDensityOptions } from 'projects/igniteui-angular/src/lib/core/displayDensity';
@Component({
// tslint:disable-next-line:component-selector
@@ -14,7 +14,7 @@ export class InputGroupChildSampleComponent {
lastName: 'Duduka'
};
- constructor(@Inject(DisplayDensityToken) public displayDensityOptions: IDisplayDensity) {}
+ constructor(@Inject(DisplayDensityToken) public displayDensityOptions: IDisplayDensityOptions) {}
changeDisplayDensity() {
switch (this.displayDensityOptions.displayDensity) {