David-Mulder / paper-datatable

A material design implementation of a data table.
GNU General Public License v3.0
237 stars 92 forks source link

added accessor to data-columns as a way to access nested data values #123

Open christophe-g opened 7 years ago

christophe-g commented 7 years ago

Allow - without defining new templates - to handle cases where data is of the form:

{
  "key": 0,
  "value": {
     "count": 10,
     "avg": 11
  }
}

in this case we would have a countAccessor like:

var countAccessor = function(d) {return d.value.count;}

and

 <paper-datatable-column header="Count"  accessor="[[countAccessor]]" type="Number"></paper-datatable-column>