Add default sort to table

This commit is contained in:
Matthew Dillon 2015-06-09 14:28:56 -08:00
parent 15b31f7c8a
commit c8ffc95068
7 changed files with 25 additions and 3 deletions

View file

@ -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']);
},
});

View file

@ -1,4 +1,10 @@
<h2>{{genus-name}} Characteristics</h2>
<h3>Total characteristics: {{model.length}}</h3>
{{sortable-table content=model tableAttrs=tableAttrs row=row}}
{{
sortable-table
content=model
tableAttrs=tableAttrs
row=row
sortProperties=sort
}}

View file

@ -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) {

View file

@ -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']);
},
});

View file

@ -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
}}

View file

@ -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']);
},
});

View file

@ -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
}}