Sortable table component
This commit is contained in:
parent
e623d52f34
commit
6ba5cf2322
23 changed files with 225 additions and 74 deletions
13
app/pods/components/sortable-table-header/component.js
Normal file
13
app/pods/components/sortable-table-header/component.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
import Ember from 'ember';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'th',
|
||||
upArrow: '▲',
|
||||
downArrow: '▼',
|
||||
|
||||
actions: {
|
||||
sortBy: function(sortProperty, ascending) {
|
||||
this.sendAction('action', sortProperty, ascending);
|
||||
}
|
||||
},
|
||||
});
|
3
app/pods/components/sortable-table-header/template.hbs
Normal file
3
app/pods/components/sortable-table-header/template.hbs
Normal file
|
@ -0,0 +1,3 @@
|
|||
{{title}}
|
||||
<span {{action 'sortBy' sortProperty true}}>{{{upArrow}}}</span>
|
||||
<span {{action 'sortBy' sortProperty false}}>{{{downArrow}}}</span>
|
Reference in a new issue