File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 39
39
* @type String
40
40
* @required
41
41
*/
42
- header : String ,
42
+ header : {
43
+ type : String ,
44
+ notify : true ,
45
+ observer : '_headerChanged'
46
+ } ,
43
47
/**
44
48
* The property to be used from `data` for this column
45
49
*
434
438
} else if ( type . toLowerCase ( ) == 'number' ) {
435
439
return 'number' ;
436
440
}
437
- }
438
-
441
+ } ,
442
+ _headerChanged : function ( header ) {
443
+ this . fire ( 'header-changed' ) ;
444
+ } ,
439
445
440
446
} ) ;
441
447
} ) ( ) ;
Original file line number Diff line number Diff line change 510
510
511
511
_queryAndSetColumns : function ( ) {
512
512
var columns = this . queryAllEffectiveChildren ( 'paper-datatable-column' ) ;
513
- columns . forEach ( ( column ) => {
513
+ columns . forEach ( ( column , index ) => {
514
514
if ( ! column . beenAttached . state . ready ) {
515
515
column . parentNodeRef = this ;
516
516
this . async ( function ( ) {
517
517
column . _registerEvilFunctions ( ) ;
518
518
column . beenAttached . ready ( ) ;
519
519
} ) ;
520
+ column . index = index ;
521
+ this . listen ( column , 'header-changed' , '_updateHeaderColumn' ) ;
520
522
}
521
523
} ) ;
522
524
this . set ( '_columns' , columns . filter ( ( column ) => ! column . inactive ) ) ;
1098
1100
1099
1101
}
1100
1102
}
1101
- }
1103
+ } ,
1104
+ _updateHeaderColumn : function ( event ) {
1105
+ var column = Polymer . dom ( event ) . localTarget ;
1106
+ this . notifyPath ( `_columns.${ column . index } .header` , this . _columns [ column . index ] . header ) ;
1107
+ } ,
1102
1108
1103
1109
} ) ;
1104
1110
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments