-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting does not take multiple pages into account #26
Comments
I added the onChangeSort handler and change the model data accordingly but sorting is still working on the displayed records only. |
@syedasadhasan You can do something like this: {{#paper-data-table
sortProp=model.sortProp
sortDir=model.sortDir
onChangeSort=(action "onChangeSort") selectable=false as |table|}}
{{!-- iterate over model.items !--}}
{{/paper-data-table}} onChangeSort({ sortProp, sortDir }) {
// if all items exists locally you can just sort 'items' instead of querying your backend.
this.fetchItemsFromByBackend({ sortProp, sortDir }) // fetch items from backend using new sort
.then((items) => {
// update items with sorted one from my backend
this.set('model', { items, sortProp, sortDir });
});
} |
I tried this and sorting is working only on the column which is set as default to sortProp in template with {{#paper-data-table}}. For any other column, when I clicked to sort, in onChangeSort action i am getting these values. sortDir=undefined and sortProp = {sortProp: "name", sortDir: "asc"}. Now when I click again on same column I got again same value for direction, sortDir=undefined and sortProp = {sortProp: "name", sortDir: "asc"}. Pls help. |
When you sort by a column it does not look at the other pages ... it just sorts current page.
Is there an action at least we can override to perform our own sorting?
The text was updated successfully, but these errors were encountered: