Last active
August 29, 2015 14:10
-
-
Save matheusdavidson/82e922b4c0e0c9b5fa66 to your computer and use it in GitHub Desktop.
Controller
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 Mixin from './../../mixins/pagination'; | |
export | |
default Ember.ArrayController.extend(Mixin, { | |
// setup our query params | |
queryParams: ["page", "perPage", "filter", "order"], | |
// setup orders | |
selOrders: [{ | |
label: 'Recente', | |
value: 'created_at-asc' | |
}, { | |
label: 'Nome (A-Z)', | |
value: 'c_name-asc' | |
}, { | |
label: 'Nome (Z-A)', | |
value: 'c_name-desc' | |
}], | |
// binding the property on the paged array | |
// to the query params on the controller | |
pageBinding: "content.page", | |
perPageBinding: "content.perPage", | |
totalPagesBinding: "content.totalPages", | |
// optional. Don't serialize default values | |
// into the URL | |
page: 1, | |
perPage: 15, | |
filter: '', | |
order: 'c_name-asc', | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment