Skip to content

Commit b75840f

Browse files
authored
Merge pull request #6976 from IgniteUI/mdragnev/fix-6931-9.0.x
fix(*): Apply custom css classes to igxGrid and igxToolbar components
2 parents a16fb03 + 1eda93a commit b75840f

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
590590
this.notifyChanges();
591591
}
592592

593+
/**
594+
* @hidden
595+
* @internal
596+
*/
597+
@Input()
598+
public class = '';
599+
593600
/**
594601
* Gets/Sets the height.
595602
* @example
@@ -619,6 +626,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
619626
get hostWidth() {
620627
return this._width || this._hostWidth;
621628
}
629+
622630
/**
623631
* Gets/Sets the width of the grid.
624632
* @example
@@ -1856,7 +1864,10 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
18561864
*/
18571865
@HostBinding('attr.class')
18581866
get hostClass(): string {
1859-
return this.getComponentDensityClass('igx-grid');
1867+
const classes = [this.getComponentDensityClass('igx-grid')];
1868+
// The custom classes should be at the end.
1869+
classes.push(this.class);
1870+
return classes.join(' ');
18601871
}
18611872

18621873
get bannerClass(): string {

projects/igniteui-angular/src/lib/grids/toolbar/grid-toolbar.component.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ export class IgxGridToolbarComponent extends DisplayDensityBase {
6868

6969
private _filterColumnsPrompt = 'Filter columns list ...';
7070

71+
/**
72+
* @hidden
73+
* @internal
74+
*/
75+
@Input()
76+
public class = '';
77+
7178
/**
7279
* Gets the height for the `IgxGridToolbarComponent`'s drop down panels.
7380
* ```typescript
@@ -211,6 +218,10 @@ export class IgxGridToolbarComponent extends DisplayDensityBase {
211218

212219
@HostBinding('attr.class')
213220
get hostClass(): string {
221+
const classes = [this.getComponentDensityClass('igx-grid-toolbar')];
222+
// The custom classes should be at the end.
223+
classes.push(this.class);
224+
return classes.join(' ');
214225
return this.getComponentDensityClass('igx-grid-toolbar');
215226
}
216227

0 commit comments

Comments
 (0)