diff --git a/paper-datatable-column.html b/paper-datatable-column.html
index 656c694..b8d1740 100644
--- a/paper-datatable-column.html
+++ b/paper-datatable-column.html
@@ -39,7 +39,11 @@
* @type String
* @required
*/
- header: String,
+ header: {
+ type: String,
+ notify: true,
+ observer: '_headerChanged'
+ },
/**
* The property to be used from `data` for this column
*
@@ -434,8 +438,10 @@
}else if(type.toLowerCase() == 'number'){
return 'number';
}
- }
-
+ },
+ _headerChanged: function(header) {
+ this.fire('header-changed');
+ },
});
})();
diff --git a/paper-datatable.html b/paper-datatable.html
index d1c8907..1dd5c85 100644
--- a/paper-datatable.html
+++ b/paper-datatable.html
@@ -510,13 +510,15 @@
_queryAndSetColumns: function(){
var columns = this.queryAllEffectiveChildren('paper-datatable-column');
- columns.forEach((column) => {
+ columns.forEach((column, index) => {
if(!column.beenAttached.state.ready){
column.parentNodeRef = this;
this.async(function(){
column._registerEvilFunctions();
column.beenAttached.ready();
});
+ column.index = index;
+ this.listen(column, 'header-changed', '_updateHeaderColumn');
}
});
this.set('_columns', columns.filter((column) => !column.inactive));
@@ -1098,7 +1100,11 @@
}
}
- }
+ },
+ _updateHeaderColumn: function(event){
+ var column = Polymer.dom(event).localTarget;
+ this.notifyPath(`_columns.${column.index}.header`, this._columns[column.index].header);
+ },
});
})();