diff --git a/paper-datatable-column.html b/paper-datatable-column.html index 656c694..b0c57c7 100644 --- a/paper-datatable-column.html +++ b/paper-datatable-column.html @@ -140,6 +140,14 @@ type: String, value: '' }, + + /** + * `cls` the class to add to th + */ + cls: { + type: String, + value: '' + }, /** * Convenience attribute to align the header and cell content (e.g. 'center') * @@ -248,7 +256,15 @@ * * @type Number in px or String */ - width: Object + width: Object, + + /** + * `accessor` a function for accessing the row value + * example: function(rowData) {return rowdata.value.count;} + */ + accessor: { + type: Function + } }, behaviors: [ Polymer.Templatizer @@ -334,7 +350,7 @@ }, _cast: function(value){ - if(typeof value === 'undefined'){ + if(typeof value === 'undefined' || value === null){ if(typeof this.default !== 'undefined'){ value = JSON.parse(JSON.stringify(this.default)); }else{ @@ -345,7 +361,7 @@ if(this.type.toLowerCase() == 'string'){ return value.toString(); }else if(this.type.toLowerCase() == 'number'){ - return parseFloat(value); + return parseFloat(value) || ''; }else if(this.type.toLowerCase() == 'boolean'){ return value ? true : false; }else if(this.type.toLowerCase() == 'date'){ diff --git a/paper-datatable.html b/paper-datatable.html index d1c8907..2715886 100644 --- a/paper-datatable.html +++ b/paper-datatable.html @@ -18,7 +18,7 @@ position: relative; } :host([resize-behavior='overflow']) #container{ - overflow: auto; + /*overflow: auto;*/ } :host([resize-behavior='dynamic-columns']) #container{ overflow: auto; @@ -249,12 +249,14 @@ @@ -285,7 +287,7 @@