diff --git a/app/pods/characteristics/route.js b/app/pods/characteristics/route.js index 873f8b3..32143d9 100644 --- a/app/pods/characteristics/route.js +++ b/app/pods/characteristics/route.js @@ -13,5 +13,6 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { controller.set('model', model); controller.set('tableAttrs', tableAttrs); controller.set('row', 'characteristic-index-row'); + controller.set('sort', ['characteristicName']); }, }); diff --git a/app/pods/characteristics/template.hbs b/app/pods/characteristics/template.hbs index 3ee1315..d9e559a 100644 --- a/app/pods/characteristics/template.hbs +++ b/app/pods/characteristics/template.hbs @@ -1,4 +1,10 @@

{{genus-name}} Characteristics

Total characteristics: {{model.length}}

-{{sortable-table content=model tableAttrs=tableAttrs row=row}} +{{ + sortable-table + content=model + tableAttrs=tableAttrs + row=row + sortProperties=sort +}} diff --git a/app/pods/components/sortable-table/component.js b/app/pods/components/sortable-table/component.js index 39ab6c0..acef098 100644 --- a/app/pods/components/sortable-table/component.js +++ b/app/pods/components/sortable-table/component.js @@ -3,6 +3,7 @@ import Ember from 'ember'; export default Ember.Component.extend(Ember.SortableMixin, { tagName: 'table', classNames: ['flakes-table'], + sortProperties: [], actions: { sortBy: function(property, ascending) { diff --git a/app/pods/species/index/route.js b/app/pods/species/index/route.js index 9208cec..6ef9dd3 100644 --- a/app/pods/species/index/route.js +++ b/app/pods/species/index/route.js @@ -13,5 +13,6 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { controller.set('model', model); controller.set('tableAttrs', tableAttrs); controller.set('row', 'species-index-row'); + controller.set('sort', ['speciesName']); }, }); diff --git a/app/pods/species/index/template.hbs b/app/pods/species/index/template.hbs index 6401737..b73fee7 100644 --- a/app/pods/species/index/template.hbs +++ b/app/pods/species/index/template.hbs @@ -3,4 +3,10 @@ {{add-button label="Add Species" link="species.new"}} -{{sortable-table content=model tableAttrs=tableAttrs row=row}} +{{ + sortable-table + content=model + tableAttrs=tableAttrs + row=row + sortProperties=sort +}} diff --git a/app/pods/strains/index/route.js b/app/pods/strains/index/route.js index 53d3820..d2515c6 100644 --- a/app/pods/strains/index/route.js +++ b/app/pods/strains/index/route.js @@ -13,5 +13,6 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, { controller.set('model', model); controller.set('tableAttrs', tableAttrs); controller.set('row', 'strain-index-row'); + controller.set('sort', ['fullName']); }, }); diff --git a/app/pods/strains/index/template.hbs b/app/pods/strains/index/template.hbs index 68a1c5a..3d91f2a 100644 --- a/app/pods/strains/index/template.hbs +++ b/app/pods/strains/index/template.hbs @@ -3,4 +3,10 @@ {{add-button label="Add Strain" link="strains.new"}} -{{sortable-table content=model tableAttrs=tableAttrs row=row}} +{{ + sortable-table + content=model + tableAttrs=tableAttrs + row=row + sortProperties=sort +}}