vuejs-smart-table icon indicating copy to clipboard operation
vuejs-smart-table copied to clipboard

Problems with @selectionChanged

Open gabrielmelian opened this issue 3 years ago • 1 comments

Hi.

I'm triying to fix a problem with @selectionChanged="selectedRows = $event" on a v-table. I'm triying to get the data after to apply a filter to export to csv. But in my selectedRows: [] never arrive the data filtered. This is my code:

<v-table :data="data" :filters="filters" @selectionChanged="selectedRows = $event" :currentPage.sync="currentPage" :pageSize="pageSize" @totalPagesChanged="totalPages = $event" class="border mx-auto block text-center table table-striped table-bordered table-condensed w-75" :rows-per-page-items="opts">

....

export default {
    name: 'DataTable',
    data: () => ({
        data,
        filters: {
            name: { value: '', keys: ['name'] },
            rate_type: { value: '', keys: ['rate_type'] },
            marketGeoUnitId: { value: '', keys: ['marketGeoUnitId'] },
            destination: { value: '', keys: ['destination'] },
            opened: { value: '', keys: ['opened'] }
        },
        order: 'asc',
        currentPage: 1,
        totalPages: 0,
        opts: [15, 30, 50, 100, -1],
        pageSize: 15,
        selectedRows: []
    }),
}

what I'm doing wrong?

I have "vuejs-smart-table": "0.0.8",

gabrielmelian avatar Nov 17 '21 08:11 gabrielmelian

I would highly recommend you update to the next version.

This is the documentation to export to csv https://vue-smart-table.netlify.app/table-state.html#rows

tochoromero avatar Dec 25 '21 13:12 tochoromero