Skip to content

Commit

Permalink
Column: accept array of paths as valuePath
Browse files Browse the repository at this point in the history
  • Loading branch information
buschtoens committed Jul 19, 2017
1 parent 5acb201 commit a058bc8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion addon/classes/Column.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,15 @@ export default class Column extends EmberObject.extend({
cellComponent: null,

/**
* The path to the `value` for this column and row. Light Table will basically
* call `Ember.get(row, valuePath)` and pass that as `rawValue` to the cell.
* The cell then formats `rawValue` and makes it available as `value`.
*
* If you pass an array, the cell will also receive an array of values as
* `rawValue` (and `value`).
*
* @property valuePath
* @type {String}
* @type {String|String[]}
*/
valuePath: null,

Expand Down
2 changes: 1 addition & 1 deletion addon/templates/components/lt-row.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#each columns as |column|}}
{{component (concat 'light-table/cells/' column.cellType) column row
table=table
rawValue=(get row column.valuePath)
rawValue=(collect row column.valuePath)
tableActions=tableActions}}
{{/each}}

0 comments on commit a058bc8

Please sign in to comment.