vuetiful icon indicating copy to clipboard operation
vuetiful copied to clipboard

DT sort while using paginator

Open gozcan opened this issue 7 years ago • 2 comments

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?

gozcan avatar Mar 16 '17 21:03 gozcan

@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>

andrewcourtice avatar Mar 17 '17 01:03 andrewcourtice

hi @andrewcourtice any workaround to achieve this ?

manik005 avatar Jul 17 '17 10:07 manik005