Skip to content

Commit aed28d3

Browse files
committed
refactor(grids): convert groupsRecords to getter, remove filteredData setter
1 parent b468f96 commit aed28d3

File tree

4 files changed

+8
-37
lines changed

4 files changed

+8
-37
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export interface IPathSegment {
4949

5050
export interface IGridDataBindable {
5151
data: any[] | null;
52-
filteredData: any[];
52+
get filteredData(): any[];
5353
}
5454

5555
export interface CellType {
@@ -565,7 +565,7 @@ export interface GridType extends IGridDataBindable {
565565
groupingExpressions?: IGroupingExpression[];
566566
groupingExpressionsChange?: EventEmitter<IGroupingExpression[]>;
567567
groupsExpanded?: boolean;
568-
groupsRecords?: IGroupByRecord[];
568+
readonly groupsRecords?: IGroupByRecord[];
569569
groupingFlatResult?: any[];
570570
groupingResult?: any[];
571571
groupingMetadata?: any[];

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
249249
@ViewChildren(IgxGridGroupByRowComponent, { read: IgxGridGroupByRowComponent })
250250
private _groupsRowList: QueryList<IgxGridGroupByRowComponent>;
251251

252+
private _groupsRecords: IGroupByRecord[] = [];
252253
/**
253254
* Gets the hierarchical representation of the group by records.
254255
*
@@ -257,7 +258,9 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
257258
* let groupRecords = this.grid.groupsRecords;
258259
* ```
259260
*/
260-
public groupsRecords: IGroupByRecord[] = [];
261+
public get groupsRecords(): IGroupByRecord[] {
262+
return this._groupsRecords;
263+
}
261264

262265
/**
263266
* @hidden @internal
@@ -339,22 +342,17 @@ export class IgxGridComponent extends IgxGridBaseDirective implements GridType,
339342
}
340343

341344
/**
342-
* Gets/Sets an array of objects containing the filtered data.
345+
* Gets an array of objects containing the filtered data.
343346
*
344347
* @example
345348
* ```typescript
346349
* let filteredData = this.grid.filteredData;
347-
* this.grid.filteredData = [...];
348350
* ```
349351
*/
350352
public get filteredData() {
351353
return this._filteredData;
352354
}
353355

354-
public set filteredData(value) {
355-
this._filteredData = value;
356-
}
357-
358356
/**
359357
* Gets/Sets the total number of records in the data source.
360358
*

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

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export class IgxChildGridRowComponent implements AfterViewInit, OnInit {
9595
@Input()
9696
public index: number;
9797

98-
@ViewChild('container', {read: ViewContainerRef, static: true})
98+
@ViewChild('container', {read: ViewContainerRef, static: true})
9999
public container: ViewContainerRef;
100100

101101
/**
@@ -412,21 +412,6 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
412412
super.excelStyleFilteringComponent;
413413
}
414414

415-
/**
416-
* Sets an array of objects containing the filtered data in the `IgxHierarchicalGridComponent`.
417-
* ```typescript
418-
* this.grid.filteredData = [{
419-
* ID: 1,
420-
* Name: "A"
421-
* }];
422-
* ```
423-
*
424-
* @memberof IgxHierarchicalGridComponent
425-
*/
426-
public set filteredData(value) {
427-
this._filteredData = value;
428-
}
429-
430415
/**
431416
* Returns an array of objects containing the filtered data in the `IgxHierarchicalGridComponent`.
432417
* ```typescript

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

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,18 +1090,6 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
10901090
public get data(): any[] | null {
10911091
return this._data;
10921092
}
1093-
/**
1094-
* Sets an array of objects containing the filtered data.
1095-
* ```typescript
1096-
* this.grid.filteredData = [{
1097-
* ID: 1,
1098-
* Name: "A"
1099-
* }];
1100-
* ```
1101-
*/
1102-
public set filteredData(value) {
1103-
this._filteredData = value;
1104-
}
11051093

11061094
/**
11071095
* Returns an array of objects containing the filtered data.

0 commit comments

Comments
 (0)