@@ -109,15 +109,16 @@ export class IgxColumnComponent implements AfterContentInit {
109
109
110
110
@Input ( )
111
111
get index ( ) : number {
112
- return this . _index ;
112
+ return this . grid . columns . indexOf ( this ) ;
113
+ // return this._index;
113
114
}
114
115
115
- set index ( value : number ) {
116
- if ( this . _index !== value ) {
117
- this . _index = value ;
118
- this . check ( ) ;
119
- }
120
- }
116
+ // set index(value: number) {
117
+ // if (this._index !== value) {
118
+ // this._index = value;
119
+ // this.check();
120
+ // }
121
+ // }
121
122
122
123
@Input ( )
123
124
public formatter : ( value : any ) => any ;
@@ -226,6 +227,9 @@ export class IgxColumnComponent implements AfterContentInit {
226
227
get visibleIndex ( ) : number {
227
228
const grid = this . gridAPI . get ( this . gridID ) ;
228
229
let vIndex = - 1 ;
230
+ if ( this . columnGroup ) {
231
+ return vIndex ;
232
+ }
229
233
if ( ! this . pinned ) {
230
234
const indexInCollection = grid . unpinnedColumns . indexOf ( this ) ;
231
235
vIndex = indexInCollection === - 1 ? - 1 : grid . pinnedColumns . length + indexInCollection ;
@@ -239,6 +243,10 @@ export class IgxColumnComponent implements AfterContentInit {
239
243
return false ;
240
244
}
241
245
246
+ get allChildren ( ) : IgxColumnComponent [ ] {
247
+ return [ ] ;
248
+ }
249
+
242
250
get level ( ) {
243
251
let ptr = this . parent ;
244
252
let lvl = 0 ;
@@ -263,7 +271,7 @@ export class IgxColumnComponent implements AfterContentInit {
263
271
protected _hidden = false ;
264
272
protected _index : number ;
265
273
266
- private _defaultMinWidth = '88' ;
274
+ protected _defaultMinWidth = '88' ;
267
275
268
276
@ContentChild ( IgxCellTemplateDirective , { read : IgxCellTemplateDirective } )
269
277
protected cellTemplate : IgxCellTemplateDirective ;
@@ -344,7 +352,7 @@ export class IgxColumnComponent implements AfterContentInit {
344
352
// should be moved as a event parameter.
345
353
346
354
if ( this . parent && ! this . parent . pinned ) {
347
- this . topLevelParent ( this ) . pinned = true ;
355
+ this . topLevelParent . pinned = true ;
348
356
return ;
349
357
}
350
358
@@ -380,7 +388,7 @@ export class IgxColumnComponent implements AfterContentInit {
380
388
381
389
protected _unpinColumn ( ) {
382
390
if ( this . parent && this . parent . pinned ) {
383
- this . topLevelParent ( this ) . pinned = false ;
391
+ this . topLevelParent . pinned = false ;
384
392
return ;
385
393
}
386
394
@@ -402,8 +410,8 @@ export class IgxColumnComponent implements AfterContentInit {
402
410
this . updateHighlights ( oldIndex , newIndex ) ;
403
411
}
404
412
405
- public topLevelParent ( column : IgxColumnComponent ) {
406
- let parent = column . parent ;
413
+ get topLevelParent ( ) {
414
+ let parent = this . parent ;
407
415
while ( parent && parent . parent ) {
408
416
parent = parent . parent ;
409
417
}
@@ -430,6 +438,53 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
430
438
@ContentChildren ( IgxColumnComponent , { read : IgxColumnComponent } )
431
439
children = new QueryList < IgxColumnComponent > ( ) ;
432
440
441
+ @Input ( )
442
+ public get summaries ( ) : any {
443
+ return this . _summaries ;
444
+ }
445
+
446
+ public set summaries ( classRef : any ) { }
447
+
448
+ @Input ( )
449
+ public searchable = true ;
450
+
451
+ @Input ( )
452
+ public get filters ( ) : any {
453
+ return this . _filters ;
454
+ }
455
+ public set filters ( classRef : any ) { }
456
+
457
+ get defaultMinWidth ( ) : string {
458
+ return this . _defaultMinWidth ;
459
+ }
460
+
461
+ get bodyTemplate ( ) : TemplateRef < any > {
462
+ return this . _bodyTemplate ;
463
+ }
464
+
465
+ set bodyTemplate ( template : TemplateRef < any > ) { }
466
+
467
+ get headerTemplate ( ) : TemplateRef < any > {
468
+ return this . _headerTemplate ;
469
+ }
470
+
471
+ set headerTemplate ( template : TemplateRef < any > ) { }
472
+
473
+ get footerTemplate ( ) : TemplateRef < any > {
474
+ return this . _headerTemplate ;
475
+ }
476
+
477
+ set footerTemplate ( template : TemplateRef < any > ) { }
478
+
479
+ get inlineEditorTemplate ( ) : TemplateRef < any > {
480
+ return this . _inlineEditorTemplate ;
481
+ }
482
+
483
+ set inlineEditorTemplate ( template : TemplateRef < any > ) { }
484
+
485
+ get cells ( ) : IgxGridCellComponent [ ] {
486
+ return [ ] ;
487
+ }
433
488
434
489
@Input ( )
435
490
get hidden ( ) {
@@ -452,6 +507,10 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
452
507
} ) ;
453
508
}
454
509
510
+ get allChildren ( ) : IgxColumnComponent [ ] {
511
+ return flatten ( this . children . toArray ( ) ) ;
512
+ }
513
+
455
514
get columnGroup ( ) {
456
515
return true ;
457
516
}
@@ -462,3 +521,8 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
462
521
463
522
set width ( val ) { }
464
523
}
524
+
525
+
526
+ function flatten ( arr : any [ ] ) {
527
+ return arr . reduce ( ( acc , val ) => Array . isArray ( val ) ? acc . concat ( flatten ( val ) ) : arr . concat ( val ) , [ ] ) ;
528
+ }
0 commit comments