Skip to content

Commit 3362901

Browse files
authored
Merge branch '15.1.x' into bpachilova/fix-13392-15.1.x
2 parents 3acf7d1 + 1318ca4 commit 3362901

File tree

7 files changed

+16
-20
lines changed

7 files changed

+16
-20
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,6 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT
11981198

11991199
private getCellType(useRow?: boolean): CellType {
12001200
const rowID = useRow ? this.grid.createRow(this.intRow.index, this.intRow.data) : this.intRow.index;
1201-
return new IgxGridCell(this.grid, rowID, this.column.field);
1201+
return new IgxGridCell(this.grid, rowID, this.column);
12021202
}
12031203
}

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1365,7 +1365,7 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
13651365
.map((rec, index) => {
13661366
if (!this.grid.isGroupByRecord(rec) && !this.grid.isSummaryRow(rec)) {
13671367
this.grid.pagingMode === 1 && this.grid.page !== 0 ? index = index + this.grid.perPage * this.grid.page : index = this.grid.dataRowList.first.index + index;
1368-
const cell = new IgxGridCell(this.grid as any, index, this.field);
1368+
const cell = new IgxGridCell(this.grid as any, index, this);
13691369
return cell;
13701370
}
13711371
}).filter(cell => cell);

projects/igniteui-angular/src/lib/grids/grid-public-cell.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,15 @@ export class IgxGridCell implements CellType {
2121
constructor(
2222
grid: GridType,
2323
row: number | RowType,
24-
column: string | ColumnType) {
24+
column: ColumnType) {
2525
this.grid = grid;
2626
if (typeof row === 'number') {
2727
this._rowIndex = row;
2828
} else {
2929
this._row = row;
3030
this._rowIndex = row.index;
3131
}
32-
if (typeof column === 'string') {
33-
this._columnField = column;
34-
} else {
35-
this._column = column;
36-
}
32+
this._column = column;
3733
}
3834

3935
/**
@@ -57,7 +53,7 @@ export class IgxGridCell implements CellType {
5753
* @memberof IgxGridCell
5854
*/
5955
public get column(): ColumnType {
60-
return this._column || this.grid.getColumnByName(this._columnField);
56+
return this._column;
6157
}
6258

6359
/**

projects/igniteui-angular/src/lib/grids/grid-public-row.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ abstract class BaseRow implements RowType {
193193
public get cells(): CellType[] {
194194
const res: CellType[] = [];
195195
this.grid.columns.forEach(col => {
196-
const cell: CellType = new IgxGridCell(this.grid, this.index, col.field);
196+
const cell: CellType = new IgxGridCell(this.grid, this.index, col);
197197
res.push(cell);
198198
});
199199
return res;
@@ -529,7 +529,7 @@ export class IgxHierarchicalGridRow extends BaseRow implements RowType {
529529
public override get cells(): CellType[] {
530530
const res: CellType[] = [];
531531
this.grid.columns.forEach(col => {
532-
const cell: CellType = new IgxGridCell(this.grid, this.index, col.field);
532+
const cell: CellType = new IgxGridCell(this.grid, this.index, col);
533533
res.push(cell);
534534
});
535535
return res;

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
533533
const row = this.getRowByIndex(rowIndex);
534534
const column = this._columns.find((col) => col.visibleIndex === index);
535535
if (row && row instanceof IgxGridRow && !row.data?.detailsData && column) {
536-
return new IgxGridCell(this, rowIndex, column.field);
536+
return new IgxGridCell(this, rowIndex, column);
537537
}
538538
}
539539

@@ -1174,7 +1174,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
11741174
if (this.pagingMode === 1 && this.page !== 0) {
11751175
row.index = rowIndex + this.perPage * this.page;
11761176
}
1177-
return new IgxGridCell(this, row.index, columnField);
1177+
return new IgxGridCell(this, row.index, column);
11781178
}
11791179
}
11801180

@@ -1194,7 +1194,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
11941194
const row = this.getRowByKey(rowSelector);
11951195
const column = this._columns.find((col) => col.field === columnField);
11961196
if (row && column) {
1197-
return new IgxGridCell(this, row.index, columnField);
1197+
return new IgxGridCell(this, row.index, column);
11981198
}
11991199
}
12001200

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
477477
const row = this.getRowByIndex(rowIndex);
478478
const column = this.columns.find((col) => col.visibleIndex === index);
479479
if (row && row instanceof IgxHierarchicalGridRow && column) {
480-
return new IgxGridCell(this, rowIndex, column.field);
480+
return new IgxGridCell(this, rowIndex, column);
481481
}
482482
}
483483

@@ -724,7 +724,7 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
724724
const row = this.getRowByIndex(rowIndex);
725725
const column = this.columns.find((col) => col.field === columnField);
726726
if (row && row instanceof IgxHierarchicalGridRow && column) {
727-
return new IgxGridCell(this, rowIndex, columnField);
727+
return new IgxGridCell(this, rowIndex, column);
728728
}
729729
}
730730

@@ -744,7 +744,7 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
744744
const row = this.getRowByKey(rowSelector);
745745
const column = this.columns.find((col) => col.field === columnField);
746746
if (row && column) {
747-
return new IgxGridCell(this, row.index, columnField);
747+
return new IgxGridCell(this, row.index, column);
748748
}
749749
}
750750

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
405405
const row = this.getRowByIndex(rowIndex);
406406
const column = this.columns.find((col) => col.visibleIndex === index);
407407
if (row && row instanceof IgxTreeGridRow && column) {
408-
return new IgxGridCell(this as any, rowIndex, column.field);
408+
return new IgxGridCell(this as any, rowIndex, column);
409409
}
410410
}
411411

@@ -791,7 +791,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
791791
const row = this.getRowByIndex(rowIndex);
792792
const column = this.columns.find((col) => col.field === columnField);
793793
if (row && row instanceof IgxTreeGridRow && column) {
794-
return new IgxGridCell(this as any, rowIndex, columnField);
794+
return new IgxGridCell(this as any, rowIndex, column);
795795
}
796796
}
797797

@@ -811,7 +811,7 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
811811
const row = this.getRowByKey(rowSelector);
812812
const column = this.columns.find((col) => col.field === columnField);
813813
if (row && column) {
814-
return new IgxGridCell(this as any, row.index, columnField);
814+
return new IgxGridCell(this as any, row.index, column);
815815
}
816816
}
817817

0 commit comments

Comments
 (0)