0

My code is as below

<v-server-table url="/campaigns" :columns="columns" :options="options">
</v-server-table>



data () {
    return {
      columns: ['name', 'start_date', 'end_date', 'partner', 'campaign_type', 'creation_date', 'created_by', 'campaign_status'],
      options: {
        compileTemplates: true,
        filterByColumn: true,
        perPage: 20,
        texts: {
          filter: 'Filter:',
          filterBy: 'Filter by {column}',
          count: ' ',
          limit: 'Records: '
        },
        datepickerOptions: {
          showDropdowns: true,
          autoUpdateInput: false
        },
        pagination: { chunk: 10, dropdown: false },
        filterable: ['name', 'start_date', 'end_date', 'partner', 'campaign_type', 'creation_date', 'created_by', 'campaign_status'],
        sortable: ['name', 'start_date', 'end_date', 'partner', 'campaign_type', 'creation_date', 'created_by', 'campaign_status'],
        headings: {
          name: 'Campaign Name',
          start_date: 'Start Date',
          end_date: 'End Date',
          id: 'CampaignId',
          partner: 'Partner',
          campaign_type: 'Campaign Type',
          creation_date: 'Creation Date',
          campaign_status: 'Status',
          created_by: 'Created By'
        }
        }
      }
    }
  }

I don't want to use direct url in the v-server-table. I have defined a function in vuex store and I want to use that function to the data using that function rather than using a URL.

how can I do that?

James Z
  • 12,209
  • 10
  • 24
  • 44
vijay singh
  • 1
  • 1
  • 2

1 Answers1

0

Use the requestFunction option listed in the documentation for Server Side in https://www.npmjs.com/package/vue-tables-2

In the function you can define your own get request function and can omit the url attribute from the table. There is an example in the docs linked above.

Tatiana Frank
  • 418
  • 5
  • 22