Add default sort to table
This commit is contained in:
parent
15b31f7c8a
commit
c8ffc95068
7 changed files with 25 additions and 3 deletions
|
@ -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']);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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
|
||||
}}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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']);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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
|
||||
}}
|
||||
|
|
|
@ -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']);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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
|
||||
}}
|
||||
|
|
Reference in a new issue