Skip to content

Commit d90a302

Browse files
authored
Merge pull request #6977 from IgniteUI/mdragnev/fix-6931-master
fix(*): Apply custom css classes to igxGrid and igxToolbar components
2 parents 8af41c0 + f4165bc commit d90a302

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,13 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
604604
this.notifyChanges();
605605
}
606606

607+
/**
608+
* @hidden
609+
* @internal
610+
*/
611+
@Input()
612+
public class = '';
613+
607614
/**
608615
* Gets/Sets the height.
609616
* @example
@@ -633,6 +640,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
633640
get hostWidth() {
634641
return this._width || this._hostWidth;
635642
}
643+
636644
/**
637645
* Gets/Sets the width of the grid.
638646
* @example
@@ -1940,7 +1948,10 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
19401948
*/
19411949
@HostBinding('attr.class')
19421950
get hostClass(): string {
1943-
return this.getComponentDensityClass('igx-grid');
1951+
const classes = [this.getComponentDensityClass('igx-grid')];
1952+
// The custom classes should be at the end.
1953+
classes.push(this.class);
1954+
return classes.join(' ');
19441955
}
19451956

19461957
get bannerClass(): string {

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

+11
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)