Last active
November 13, 2020 02:06
-
-
Save onechiporenko/471b15cc58812b2a7da932f393677b37 to your computer and use it in GitHub Desktop.
Ember Models Table with Semantic UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
collapseAllRows() { | |
Ember.get(this, 'collapseAllRows')(); | |
}, | |
expandAllRows() { | |
Ember.get(this, 'expandAllRows')(); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
collapseRow(index, record) { | |
Ember.get(this, 'collapseRow')(index, record); | |
}, | |
expandRow(index, record) { | |
Ember.get(this, 'expandRow')(index, record); | |
} | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import Select from 'ember-models-table/components/models-table/select'; | |
export default Select.extend({ | |
classNames: ['ui fluid dropdown'] | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import Semantic from 'app/themes/semantic'; | |
export default Ember.Controller.extend({ | |
useNumericPagination: false, | |
expandedRowComponent: 'expanded-row', | |
columns: [ | |
{ | |
component: 'expand-toggle', | |
componentForFilterCell: 'expand-all-toggle', | |
mayBeHidden: false | |
}, | |
{propertyName: 'id'}, | |
{propertyName: 'firstName'}, | |
{propertyName: 'lastName', filterWithSelect: true} | |
], | |
columnSets: [ | |
{ | |
"label": "Only Name", | |
"showColumns": [ | |
"firstName", | |
"lastName" | |
] | |
} | |
], | |
themeInstance: Semantic | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model() { | |
return Promise.resolve([ | |
{id: '1', firstName: 'Jim', lastName: 'Raynor'}, | |
{id: '2', firstName: 'Sarah', lastName: 'Kerrigan'}, | |
{id: '3', firstName: 'Rory', lastName: 'Swann'}, | |
{id: '4', firstName: 'Tychus', lastName: 'Findlay'}, | |
{id: '5', firstName: 'Nova', lastName: 'Tera'}, | |
{id: '6', firstName: 'Gabriel', lastName: 'Tosh'}, | |
{id: '7', firstName: 'Egon', lastName: 'Stetmann'}, | |
{id: '8', firstName: 'Horace', lastName: 'Warfield'}, | |
{id: '9', firstName: 'Carolina', lastName: 'Davis'}, | |
{id: '10', firstName: 'Alexei', lastName: 'Stukov'}, | |
{id: '11', firstName: 'Valerian', lastName: 'Mengsk'}, | |
{id: '12', firstName: 'Ariel', lastName: 'Hanson'}, | |
{id: '13', firstName: 'Matt', lastName: 'Horner'}, | |
{id: '1', firstName: 'Jim', lastName: 'Raynor'}, | |
{id: '2', firstName: 'Sarah', lastName: 'Kerrigan'}, | |
{id: '3', firstName: 'Rory', lastName: 'Swann'}, | |
{id: '4', firstName: 'Tychus', lastName: 'Findlay'}, | |
{id: '5', firstName: 'Nova', lastName: 'Tera'}, | |
{id: '6', firstName: 'Gabriel', lastName: 'Tosh'}, | |
{id: '7', firstName: 'Egon', lastName: 'Stetmann'}, | |
{id: '8', firstName: 'Horace', lastName: 'Warfield'}, | |
{id: '9', firstName: 'Carolina', lastName: 'Davis'}, | |
{id: '10', firstName: 'Alexei', lastName: 'Stukov'}, | |
{id: '11', firstName: 'Valerian', lastName: 'Mengsk'}, | |
{id: '12', firstName: 'Ariel', lastName: 'Hanson'}, | |
{id: '13', firstName: 'Matt', lastName: 'Horner'}, | |
{id: '1', firstName: 'Jim', lastName: 'Raynor'}, | |
{id: '2', firstName: 'Sarah', lastName: 'Kerrigan'}, | |
{id: '3', firstName: 'Rory', lastName: 'Swann'}, | |
{id: '4', firstName: 'Tychus', lastName: 'Findlay'}, | |
{id: '5', firstName: 'Nova', lastName: 'Tera'}, | |
{id: '6', firstName: 'Gabriel', lastName: 'Tosh'}, | |
{id: '7', firstName: 'Egon', lastName: 'Stetmann'}, | |
{id: '8', firstName: 'Horace', lastName: 'Warfield'}, | |
{id: '9', firstName: 'Carolina', lastName: 'Davis'}, | |
{id: '10', firstName: 'Alexei', lastName: 'Stukov'}, | |
{id: '11', firstName: 'Valerian', lastName: 'Mengsk'}, | |
{id: '12', firstName: 'Ariel', lastName: 'Hanson'}, | |
{id: '13', firstName: 'Matt', lastName: 'Horner'}, | |
{id: '1', firstName: 'Jim', lastName: 'Raynor'}, | |
{id: '2', firstName: 'Sarah', lastName: 'Kerrigan'}, | |
{id: '3', firstName: 'Rory', lastName: 'Swann'}, | |
{id: '4', firstName: 'Tychus', lastName: 'Findlay'}, | |
{id: '5', firstName: 'Nova', lastName: 'Tera'}, | |
{id: '6', firstName: 'Gabriel', lastName: 'Tosh'}, | |
{id: '7', firstName: 'Egon', lastName: 'Stetmann'}, | |
{id: '8', firstName: 'Horace', lastName: 'Warfield'}, | |
{id: '9', firstName: 'Carolina', lastName: 'Davis'}, | |
{id: '10', firstName: 'Alexei', lastName: 'Stukov'}, | |
{id: '11', firstName: 'Valerian', lastName: 'Mengsk'}, | |
{id: '12', firstName: 'Ariel', lastName: 'Hanson'}, | |
{id: '13', firstName: 'Matt', lastName: 'Horner'}, | |
{id: '1', firstName: 'Jim', lastName: 'Raynor'}, | |
{id: '2', firstName: 'Sarah', lastName: 'Kerrigan'}, | |
{id: '3', firstName: 'Rory', lastName: 'Swann'}, | |
{id: '4', firstName: 'Tychus', lastName: 'Findlay'}, | |
{id: '5', firstName: 'Nova', lastName: 'Tera'}, | |
{id: '6', firstName: 'Gabriel', lastName: 'Tosh'}, | |
{id: '7', firstName: 'Egon', lastName: 'Stetmann'}, | |
{id: '8', firstName: 'Horace', lastName: 'Warfield'}, | |
{id: '9', firstName: 'Carolina', lastName: 'Davis'}, | |
{id: '10', firstName: 'Alexei', lastName: 'Stukov'}, | |
{id: '11', firstName: 'Valerian', lastName: 'Mengsk'}, | |
{id: '12', firstName: 'Ariel', lastName: 'Hanson'}, | |
{id: '13', firstName: 'Matt', lastName: 'Horner'}, | |
{id: '1', firstName: 'Jim', lastName: 'Raynor'}, | |
{id: '2', firstName: 'Sarah', lastName: 'Kerrigan'}, | |
{id: '3', firstName: 'Rory', lastName: 'Swann'}, | |
{id: '4', firstName: 'Tychus', lastName: 'Findlay'}, | |
{id: '5', firstName: 'Nova', lastName: 'Tera'}, | |
{id: '6', firstName: 'Gabriel', lastName: 'Tosh'}, | |
{id: '7', firstName: 'Egon', lastName: 'Stetmann'}, | |
{id: '8', firstName: 'Horace', lastName: 'Warfield'}, | |
{id: '9', firstName: 'Carolina', lastName: 'Davis'}, | |
{id: '10', firstName: 'Alexei', lastName: 'Stukov'}, | |
{id: '11', firstName: 'Valerian', lastName: 'Mengsk'}, | |
{id: '12', firstName: 'Ariel', lastName: 'Hanson'}, | |
{id: '13', firstName: 'Matt', lastName: 'Horner'}, | |
]); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Default from './default'; | |
import Ember from 'ember'; | |
const {computed: {alias}} = Ember; | |
export default Default.extend({ | |
table: 'ui selectable striped celled sortable table', | |
'column-visible': 'toggle on icon', | |
'column-hidden': 'toggle off icon', | |
'sort-asc': 'sort ascending icon', | |
'sort-desc': 'sort descending icon', | |
clearAllFiltersIcon: 'remove circle icon', | |
footerSummaryNumericPagination: 'nine wide column', | |
footerSummaryDefaultPagination: alias('footerSummaryNumericPagination'), | |
pageSizeWrapper: 'two wide column', | |
paginationWrapperNumeric: 'five wide column', | |
paginationWrapperDefault: alias('paginationWrapperNumeric'), | |
tfooterInternalWrapper: 'ui grid', | |
}).create(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.12.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "2.12.0", | |
"ember-template-compiler": "2.12.0", | |
"ember-testing": "2.12.0" | |
}, | |
"addons": { | |
"ember-data": "2.12.1", | |
"ember-models-table": "2.0.0-beta.3", | |
"semantic-ui-ember": "2.0.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment