Skip to content

Commit e0636ce

Browse files
Merge pull request #7851 from IgniteUI/ibarakov/fix-7379-10.1.x
feat(grid): create a setter for grid's outlet #7379
2 parents f8cdc44 + 31c94a4 commit e0636ce

14 files changed

+55
-33
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ The following example shows how you can use the Indigo theme:
9797
- `IgxSelect` support for `igxHint` directive added.
9898
- Allows the user to add `igxHint` to be displayed bellow the input element.
9999

100+
## 9.1.9
101+
102+
### New Features
103+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
104+
- Expose a setter for grid's `outlet` property, which can be used to set the outlet used to attach the grid's overlays to.
105+
100106
## 9.1.4
101107

102108
### New Features

projects/igniteui-angular/src/lib/grids/cell.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
[igxFocus]="true" [disableRipple]="true"></igx-checkbox>
3737
</ng-container>
3838
<ng-container *ngIf="column.dataType === 'date'">
39-
<igx-date-picker [style.width.%]="100" [outlet]="grid.outletDirective" mode="dropdown"
39+
<igx-date-picker [style.width.%]="100" [outlet]="grid.outlet" mode="dropdown"
4040
[locale]="grid.locale" [(value)]="editValue" [igxFocus]="true" [labelVisibility]="false">
4141
</igx-date-picker>
4242
</ng-container>

projects/igniteui-angular/src/lib/grids/common/grid.interface.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface GridType extends IGridDataBindable {
3030
selectionService: any;
3131
navigation: any;
3232
filteringService: any;
33-
outletDirective: any;
33+
outlet: any;
3434

3535
calcHeight: number;
3636

projects/igniteui-angular/src/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ <h6 class="igx-filter-empty__title">
184184
mode="dropdown"
185185
[(ngModel)]="searchValue"
186186
[locale]="grid.locale"
187-
[outlet]="grid.outletDirective">
187+
[outlet]="grid.outlet">
188188
<ng-template igxDatePickerTemplate let-openDialog="openDialog" let-value="value">
189189
<igx-input-group #dropDownTarget type="box" [displayDensity]="'compact'">
190190
<input #searchValueInput

projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
tabindex="0"
4747
mode="dropdown"
4848
[value]="value"
49-
[outlet]="filteringService.grid.outletDirective"
49+
[outlet]="filteringService.grid.outlet"
5050
[locale]="filteringService.grid.locale"
5151
(onSelection)="onDateSelected($event)"
5252
(onClosed)="datePickerClose()">

projects/igniteui-angular/src/lib/grids/filtering/base/grid-filtering-row.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
147147
constructor(public filteringService: IgxFilteringService, public element: ElementRef, public cdr: ChangeDetectorRef) { }
148148

149149
ngAfterViewInit() {
150-
this._conditionsOverlaySettings.outlet = this.column.grid.outletDirective;
151-
this._operatorsOverlaySettings.outlet = this.column.grid.outletDirective;
150+
this._conditionsOverlaySettings.outlet = this.column.grid.outlet;
151+
this._operatorsOverlaySettings.outlet = this.column.grid.outlet;
152152

153153
const selectedItem = this.expressionsList.find(expr => expr.isSelected === true);
154154
if (selectedItem) {

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-date-expression.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</igx-select-item>
1515
</igx-select>
1616

17-
<igx-date-picker #datePicker mode="dropdown" [(ngModel)]="expressionUI.expression.searchVal" [locale]="grid.locale" [outlet]="grid.outletDirective">
17+
<igx-date-picker #datePicker mode="dropdown" [(ngModel)]="expressionUI.expression.searchVal" [locale]="grid.locale" [outlet]="grid.outlet">
1818
<ng-template igxDatePickerTemplate let-openDialog="openDialog" let-value="value">
1919
<igx-input-group #dropDownTarget type="box" [displayDensity]="displayDensity">
2020
<input #input

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

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
208208
positionStrategy: new ConnectedPositioningStrategy(this._advancedFilteringPositionSettings),
209209
};
210210

211+
protected _userOutletDirective: IgxOverlayOutletDirective;
212+
211213
/**
212214
* @hidden @internal
213215
*/
@@ -1816,20 +1818,12 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
18161818
@ViewChild('tfoot', { static: true })
18171819
public tfoot: ElementRef;
18181820

1819-
18201821
/**
18211822
* @hidden @internal
18221823
*/
18231824
@ViewChild('igxFilteringOverlayOutlet', { read: IgxOverlayOutletDirective, static: true })
18241825
protected _outletDirective: IgxOverlayOutletDirective;
18251826

1826-
/**
1827-
* @hidden @internal
1828-
*/
1829-
public get outletDirective() {
1830-
return this._outletDirective;
1831-
}
1832-
18331827
/**
18341828
* @hidden @internal
18351829
*/
@@ -1854,7 +1848,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
18541848
* @hidden @internal
18551849
*/
18561850
public get parentRowOutletDirective() {
1857-
return this.outletDirective;
1851+
return this.outlet;
18581852
}
18591853

18601854
/**
@@ -2946,7 +2940,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
29462940
return;
29472941
}
29482942

2949-
if (this.overlayService.getOverlayById(event.id)?.settings?.outlet === this.outletDirective &&
2943+
if (this.overlayService.getOverlayById(event.id)?.settings?.outlet === this.outlet &&
29502944
this.overlayIDs.indexOf(event.id) < 0) {
29512945
this.overlayIDs.push(event.id);
29522946
}
@@ -3384,10 +3378,23 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
33843378
}
33853379

33863380
/**
3387-
* @hidden @internal
3381+
* Gets the outlet used to attach the grid's overlays to.
3382+
* @remark
3383+
* If set, returns the outlet defined outside the grid. Otherwise returns the grid's internal outlet directive.
3384+
*/
3385+
get outlet() {
3386+
return this.resolveOutlet();
3387+
}
3388+
3389+
protected resolveOutlet() {
3390+
return this._userOutletDirective ? this._userOutletDirective : this._outletDirective;
3391+
}
3392+
3393+
/**
3394+
* Sets the outlet used to attach the grid's overlays to.
33883395
*/
3389-
protected get outlet() {
3390-
return this.outletDirective;
3396+
set outlet(val: any) {
3397+
this._userOutletDirective = val;
33913398
}
33923399

33933400
/**
@@ -6509,7 +6516,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
65096516
if (!this._advancedFilteringOverlayId) {
65106517
this._advancedFilteringOverlaySettings.positionStrategy.settings.target =
65116518
(this as any).rootGrid ? (this as any).rootGrid.nativeElement : this.nativeElement;
6512-
this._advancedFilteringOverlaySettings.outlet = this.outletDirective;
6519+
this._advancedFilteringOverlaySettings.outlet = this.outlet;
65136520

65146521
this._advancedFilteringOverlayId = this.overlayService.attach(
65156522
IgxAdvancedFilteringDialogComponent,

projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<igx-checkbox (change)="editValue = $event.checked" [value]="editValue" [checked]="editValue" [disableRipple]="true"></igx-checkbox>
2828
</ng-container>
2929
<ng-container *ngIf="column.dataType === 'date'">
30-
<igx-date-picker [style.width.%]="100" [outlet]="grid.outletDirective" mode="dropdown"
30+
<igx-date-picker [style.width.%]="100" [outlet]="grid.outlet" mode="dropdown"
3131
[locale]="grid.locale" [(value)]="editValue" [igxFocus]="true" [labelVisibility]="false">
3232
</igx-date-picker>
3333
</ng-container>

projects/igniteui-angular/src/lib/grids/headers/grid-header-group.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[column]="child"
1515
[gridID]="child.grid.id"
1616
[igxColumnMovingDrag]="child"
17-
[ghostHost]="grid.outletDirective.nativeElement"
17+
[ghostHost]="grid.outlet.nativeElement"
1818
[attr.droppable]="true"
1919
[igxColumnMovingDrop]="child">
2020
</igx-grid-header-group>
@@ -48,7 +48,7 @@
4848
'igx-grid__th--selected': selected,
4949
'igx-grid__th--active': activeGroup}"
5050
[igxColumnMovingDrag]="column"
51-
[ghostHost]="grid.outletDirective.nativeElement"
51+
[ghostHost]="grid.outlet.nativeElement"
5252
[attr.droppable]="true"
5353
[igxColumnMovingDrop]="column"
5454
(pointerdown)="activate()"
@@ -81,7 +81,7 @@
8181

8282
<ng-container *ngIf="!column.columnGroup">
8383
<span *ngIf="grid.hasMovableColumns" class="igx-grid__th-drop-indicator-left"></span>
84-
<igx-grid-header [igxColumnMovingDrag]="column" [ghostHost]="grid.outletDirective.nativeElement" [attr.droppable]="true" (pointerdown)="activate()" [igxColumnMovingDrop]="column" [gridID]="column.grid.id" [column]="column"></igx-grid-header>
84+
<igx-grid-header [igxColumnMovingDrag]="column" [ghostHost]="grid.outlet.nativeElement" [attr.droppable]="true" (pointerdown)="activate()" [igxColumnMovingDrop]="column" [gridID]="column.grid.id" [column]="column"></igx-grid-header>
8585
<igx-grid-filtering-cell *ngIf="grid.allowFiltering && grid.filterMode == 'quickFilter'" [column]="column" [attr.draggable]="false"></igx-grid-filtering-cell>
8686
<span *ngIf="!column.columnGroup && column.resizable" class="igx-grid__th-resize-handle"
8787
[igxResizeHandle]="column"

0 commit comments

Comments
 (0)