File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3939 * @type String
4040 * @required
4141 */
42- header : String ,
42+ header : {
43+ type : String ,
44+ notify : true ,
45+ observer : '_headerChanged'
46+ } ,
4347 /**
4448 * The property to be used from `data` for this column
4549 *
434438 } else if ( type . toLowerCase ( ) == 'number' ) {
435439 return 'number' ;
436440 }
437- }
438-
441+ } ,
442+ _headerChanged : function ( header ) {
443+ this . fire ( 'header-changed' ) ;
444+ } ,
439445
440446 } ) ;
441447 } ) ( ) ;
Original file line number Diff line number Diff line change 510510
511511 _queryAndSetColumns : function ( ) {
512512 var columns = this . queryAllEffectiveChildren ( 'paper-datatable-column' ) ;
513- columns . forEach ( ( column ) => {
513+ columns . forEach ( ( column , index ) => {
514514 if ( ! column . beenAttached . state . ready ) {
515515 column . parentNodeRef = this ;
516516 this . async ( function ( ) {
517517 column . _registerEvilFunctions ( ) ;
518518 column . beenAttached . ready ( ) ;
519519 } ) ;
520+ column . index = index ;
521+ this . listen ( column , 'header-changed' , '_updateHeaderColumn' ) ;
520522 }
521523 } ) ;
522524 this . set ( '_columns' , columns . filter ( ( column ) => ! column . inactive ) ) ;
10981100
10991101 }
11001102 }
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+ } ,
11021108
11031109 } ) ;
11041110 } ) ( ) ;
You can’t perform that action at this time.
0 commit comments