Skip to content
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

DT sort while using paginator #10

Open
gozcan opened this issue Mar 16, 2017 · 2 comments
Open

DT sort while using paginator #10

gozcan opened this issue Mar 16, 2017 · 2 comments

Comments

@gozcan
Copy link

gozcan commented Mar 16, 2017

Hey, I guess when you use paginator on a datatable; since you bind paginator's page data to datatable, it only sorts displayed data rather than whole dataset. Is there a config to prevent this?

@andrewcourtice
Copy link
Owner

@gozcan At this stage there is no config to support this. This is by design to prevent components depending on each other. I used to have the datatable emit a sort event when you clicked the column to sort but I've since removed it while I was changing the structure of the component around.

Once I put the sort event back on the component you can just listen to that event and sort the original data based on that column. It would probably look something like this:

<paginator :source="sortedData" :page-size="5">
    <template scope="page">
        <datatable :source="page.data" @sort="sortData(columnId, direction)">
            <!-- Datatable columns & templates -->
        </datatable>
    </template>
</paginator>

@manik005
Copy link

hi @andrewcourtice any workaround to achieve this ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants