Skip to content

Commit 0009607

Browse files
authored
Merge branch 'master' into mdragnev/addrow-templating
2 parents 3949ef4 + 1262bd2 commit 0009607

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

projects/igniteui-angular/src/lib/grids/common/pipes.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
12
import { Pipe, PipeTransform, Inject } from '@angular/core';
23
import { GridBaseAPIService } from '../api.service';
34
import { IgxGridBaseDirective } from '../grid-base.directive';
@@ -17,7 +18,7 @@ import { IgxColumnActionsComponent } from '../column-actions/column-actions.comp
1718
})
1819
export class IgxGridCellStyleClassesPipe implements PipeTransform {
1920

20-
transform(cssClasses: { [prop: string]: any }, _: any, data: any, field: string, index: number, __: number): string {
21+
public transform(cssClasses: { [prop: string]: any }, _: any, data: any, field: string, index: number, __: number): string {
2122
if (!cssClasses) {
2223
return '';
2324
}
@@ -46,7 +47,8 @@ export class IgxGridCellStyleClassesPipe implements PipeTransform {
4647
})
4748
export class IgxGridCellStylesPipe implements PipeTransform {
4849

49-
transform(styles: { [prop: string]: any }, _: any, data: any, field: string, index: number, __: number): { [prop: string]: any } {
50+
public transform(styles: { [prop: string]: any }, _: any, data: any, field: string, index: number, __: number):
51+
{ [prop: string]: any } {
5052
const css = {};
5153
if (!styles) {
5254
return css;
@@ -70,7 +72,7 @@ export class IgxGridCellStylesPipe implements PipeTransform {
7072
})
7173
export class IgxGridNotGroupedPipe implements PipeTransform {
7274

73-
transform(value: any[]): any[] {
75+
public transform(value: any[]): any[] {
7476
return value.filter(item => !item.columnGroup);
7577
}
7678
}
@@ -84,7 +86,7 @@ export class IgxGridNotGroupedPipe implements PipeTransform {
8486
})
8587
export class IgxGridTopLevelColumns implements PipeTransform {
8688

87-
transform(value: any[]): any[] {
89+
public transform(value: any[]): any[] {
8890
return value.filter(item => item.level === 0);
8991
}
9092
}
@@ -116,7 +118,7 @@ export class IgxGridTransactionPipe implements PipeTransform {
116118

117119
constructor(private gridAPI: GridBaseAPIService<IgxGridBaseDirective & GridType>) { }
118120

119-
transform(collection: any[], id: string, pipeTrigger: number) {
121+
public transform(collection: any[], id: string, pipeTrigger: number) {
120122
const grid: IgxGridBaseDirective = this.gridAPI.grid;
121123

122124
if (grid.transactions.enabled) {
@@ -153,7 +155,7 @@ export class IgxGridPaginatorOptionsPipe implements PipeTransform {
153155
pure: true
154156
})
155157
export class IgxHasVisibleColumnsPipe implements PipeTransform {
156-
transform(values: any[], hasVisibleColumns) {
158+
public transform(values: any[], hasVisibleColumns) {
157159
if (!(values && values.length)) {
158160
return values;
159161
}
@@ -268,23 +270,23 @@ export class IgxSortActionColumnsPipe implements PipeTransform {
268270
@Pipe({ name: 'dataMapper' })
269271
export class IgxGridDataMapperPipe implements PipeTransform {
270272

271-
transform(data: any[], field: string, _: number, val: any, isNestedPath: boolean) {
273+
public transform(data: any[], field: string, _: number, val: any, isNestedPath: boolean) {
272274
return isNestedPath ? resolveNestedPath(data, field) : val;
273275
}
274276
}
275277

276278
@Pipe({ name: 'igxStringReplace' })
277279
export class IgxStringReplacePipe implements PipeTransform {
278280

279-
transform(value: string, search: string | RegExp, replacement: string): string {
281+
public transform(value: string, search: string | RegExp, replacement: string): string {
280282
return value.replace(search, replacement);
281283
}
282284
}
283285

284286
@Pipe({ name: 'transactionState' })
285287
export class IgxGridTransactionStatePipe implements PipeTransform {
286288

287-
transform(row_id: any, field: string, rowEditable: boolean, transactions: any, _: any, __: any, ___: any) {
289+
public transform(row_id: any, field: string, rowEditable: boolean, transactions: any, _: any, __: any, ___: any) {
288290
if (rowEditable) {
289291
const rowCurrentState = transactions.getAggregatedValue(row_id, false);
290292
if (rowCurrentState) {
@@ -302,7 +304,7 @@ export class IgxGridTransactionStatePipe implements PipeTransform {
302304
@Pipe({ name: 'columnFormatter' })
303305
export class IgxColumnFormatterPipe implements PipeTransform {
304306

305-
transform(value: any, formatter: (v: any) => any) {
307+
public transform(value: any, formatter: (v: any) => any) {
306308
return formatter(value);
307309
}
308310
}
@@ -315,7 +317,7 @@ export class IgxGridAddRowPipe implements PipeTransform {
315317

316318
constructor(private gridAPI: GridBaseAPIService<IgxGridBaseDirective & GridType>) { }
317319

318-
transform(collection: any, isPinned = false, pipeTrigger: number) {
320+
public transform(collection: any, isPinned = false, pipeTrigger: number) {
319321
const grid = this.gridAPI.grid;
320322
if (!grid.rowEditable || !grid.addRowParent || grid.cancelAddMode || isPinned !== grid.addRowParent.isPinned) {
321323
return collection;

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,9 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
17261726
public set isLoading(value: boolean) {
17271727
if (this._isLoading !== value) {
17281728
this._isLoading = value;
1729-
this.evaluateLoadingState();
1729+
if (!!this.data) {
1730+
this.evaluateLoadingState();
1731+
}
17301732
}
17311733
Promise.resolve().then(() => {
17321734
// wait for the current detection cycle to end before triggering a new one.

src/app/grid-events/grid-events.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ export class GridEventsComponent {
8888
this.logAnEvent('=> columnVisibilityChanging', event.cancel);
8989
}
9090
public onColumnVisibilityChanged(event: IColumnVisibilityChangedEventArgs) {
91+
console.log('event' + event);
9192
this.logAnEvent(`=> onColumnVisibilityChanged`);
9293
}
9394

src/app/hierarchical-grid-remote/hierarchical-grid-remote.sample.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<igx-column field="ContactTitle"></igx-column>
1414
<igx-column field="Country"></igx-column>
1515
<igx-column field="Phone"></igx-column>
16-
<igx-row-island #rowIsland1 [key]="'Orders'" [isLoading]="true" [primaryKey]="'OrderID'" [autoGenerate]="false" [rowSelection]='selectionMode' (onGridCreated)="gridCreated($event, rowIsland1)" [emptyGridMessage]="''">
16+
<igx-row-island #rowIsland1 [key]="'Orders'" [primaryKey]="'OrderID'" [autoGenerate]="false" [rowSelection]='selectionMode' (onGridCreated)="gridCreated($event, rowIsland1)" [emptyGridMessage]="''">
1717
<igx-grid-toolbar [grid]="grid" *igxGridToolbar="let grid">
1818
<igx-grid-toolbar-title>Child Toolbar - Level {{ grid.parentIsland.level }}</igx-grid-toolbar-title>
1919
<igx-grid-toolbar-actions>
@@ -25,7 +25,7 @@
2525
<igx-column field="ShipCountry"></igx-column>
2626
<igx-column field="ShipCity"></igx-column>
2727
<igx-column field="ShipAddress"></igx-column>
28-
<igx-row-island #rowIsland2 [key]="'Order_Details'" [isLoading]="true" [primaryKey]="'ProductID'" [autoGenerate]="false" [rowSelection]='selectionMode' (onGridCreated)="gridCreated($event, rowIsland2)" [emptyGridMessage]="''">
28+
<igx-row-island #rowIsland2 [key]="'Order_Details'" [primaryKey]="'ProductID'" [autoGenerate]="false" [rowSelection]='selectionMode' (onGridCreated)="gridCreated($event, rowIsland2)" [emptyGridMessage]="''">
2929
<igx-grid-toolbar [grid]="grid" *igxGridToolbar="let grid">
3030
<igx-grid-toolbar-title>Child Toolbar - Level {{ grid.parentIsland.level }}</igx-grid-toolbar-title>
3131
<igx-grid-toolbar-actions>

src/app/hierarchical-grid-remote/hierarchical-grid-remote.sample.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export class HierarchicalGridRemoteSampleComponent implements AfterViewInit {
7272
}
7373

7474
public gridCreated(event: IGridCreatedEventArgs, rowIsland: IgxRowIslandComponent) {
75+
event.grid.isLoading = true;
7576
this.remoteService.getData({ parentID: event.parentID, level: rowIsland.level, key: rowIsland.key }, (data) => {
7677
event.grid.data = data['value'];
7778
event.grid.isLoading = false;

0 commit comments

Comments
 (0)