diff --git a/addon/components/data-table-content-body.js b/addon/components/data-table-content-body.js index f143fac..73d98f1 100644 --- a/addon/components/data-table-content-body.js +++ b/addon/components/data-table-content-body.js @@ -1,5 +1,5 @@ import { set } from '@ember/object'; -import { computed } from '@ember/object'; +import { action, computed } from '@ember/object'; import Component from '@ember/component'; import layout from '../templates/components/data-table-content-body'; @@ -32,16 +32,14 @@ export default Component.extend({ }); } ), - actions: { - updateSelection(selectedWrapper, event) { - set(selectedWrapper, 'isSelected', event.target.checked); - this.wrappedItems.forEach((wrapper) => { - if (wrapper.isSelected) { - this.get('data-table').addItemToSelection(wrapper.item); - } else { - this.get('data-table').removeItemFromSelection(wrapper.item); - } - }); - }, - }, + updateSelection: action(function (selectedWrapper, event) { + set(selectedWrapper, 'isSelected', event.target.checked); + this.wrappedItems.forEach((wrapper) => { + if (wrapper.isSelected) { + this.get('data-table').addItemToSelection(wrapper.item); + } else { + this.get('data-table').removeItemFromSelection(wrapper.item); + } + }); + }), }); diff --git a/addon/templates/components/data-table-content-body.hbs b/addon/templates/components/data-table-content-body.hbs index 38c5bbb..ab8bbe7 100644 --- a/addon/templates/components/data-table-content-body.hbs +++ b/addon/templates/components/data-table-content-body.hbs @@ -6,7 +6,8 @@