From 5cb93b9cc968dd36dd444b3ea0589c52445922fb Mon Sep 17 00:00:00 2001 From: Andrew Moon Date: Fri, 13 Jan 2017 16:48:36 -0600 Subject: [PATCH] TPF-856 - Made changes to allow for selecting rows with a checkbox. --- addon/components/models-table.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/addon/components/models-table.js b/addon/components/models-table.js index a0b9ea51..7d6d3f6a 100644 --- a/addon/components/models-table.js +++ b/addon/components/models-table.js @@ -342,6 +342,8 @@ export default Component.extend({ let d = Ember.copy(columnMap[col.propertyName]); columns.push(Ember.merge(d, col)); usedNames.push(col.propertyName); + } else if (!col.propertyName) { + columns.push(col); } else { Ember.warn(`No propertyName found for ${col.propertyName}`, false, {id: 'data-table.columns-builder'}); } @@ -585,7 +587,7 @@ export default Component.extend({ * @private * @name ModelsTable#_selectedItems */ - _selectedItems: null, + _selectedItems: A([]), /** * @type {boolean} @@ -982,7 +984,6 @@ export default Component.extend({ * @name ModelsTable#setup */ setup: on('init', function() { - this._setupSelectedRows(); this._setupExpandedRows(); this._setupColumns(); this._setupMessages(); @@ -1022,10 +1023,6 @@ export default Component.extend({ set(this, '_expandedRowIndexes', A([])); }, - _setupSelectedRows() { - set(this, '_selectedItems', A([])); - }, - /** * Wrapper for _setupColumns to call it only once when observer is fired *