vue-tables-2
  • Dependencies & Compatability
  • Getting Started
    • Vue Version 3
  • Client Table
    • Asynchronous Loading
    • Grouping
    • Filtering Algorithm
    • Editable Cells
  • Server Table
    • Implementations
    • Custom Request Function
    • Setting Multiple Request Parameters
    • Error Message
    • Draw Counter
  • Virtual Pagination
  • Custom Template
  • Column Templates
  • Nested Data Structures
  • Selectable Rows
  • Date Columns
  • List Filters
  • Custom Filters
  • Custom Sorting
  • Multiple Sorting
  • Child Rows
  • Conditional Cell Styling
  • Columns Visibility
  • Methods
  • Properties
  • Events
  • Slots
  • Options API
Powered by GitBook
On this page

Was this helpful?

  1. Server Table

Setting Multiple Request Parameters

Set all request parameters programatically

PreviousCustom Request FunctionNextError Message

Last updated 4 years ago

Was this helpful?

While there are for setting each parameter of the table (e.g `setLimit`, `setFilter`, `setOrder` etc.), each of those methods would trigger a request to the server. Sometimes you may wish to set multiple parameters at once with a single request. The setRequestParams method allows for that. E.g:

this.$refs.myTable.setRequestParams({
  page:2,
  limit:10,
  order:{column:'created_at',ascending:false},
  filters: 'Some value',
  customFilters:{
    myCustomFilter:100
  }
})

Each key on this object maps to the used to set this specific key:

page: setPage

limit: setLimit

order: setOrder

filters: setFilter

customFilters: setCustomFilters

So for example, if you use filterByColumn:true you would pass to the filters key an object of key-value pairs, rather than a string.

methods
method