1

I have a three custom filters working on change select.

But because of the way I use button on click all the filter on single method.

Right now setting the custom filter and setting the page results in two calls to the server and it's causing me problems.

How can I set the page and the custom filter in a single operation so only one call is made ?

 filterData() {
   Event.$emit('vue-tables.filter::category', this.selectCategory)
   Event.$emit('vue-tables.filter::date', this.selectDate)
   Event.$emit('vue-tables.filter::type', this.selectType)
},

How to do the above so only one call is made to the server ?

priyeshvadhiya
  • 606
  • 3
  • 8
  • 27

1 Answers1

0

var filterData = () {
 var reqObj = {
  category:this.selectCategory,
  date:this.selectDate,
  type:this.selectType
};
this.$refs.filterTable.customQueries = reqObj;
this.$refs.filterTable.refresh();
}
<v-server-table ref="filterTable" :columns="data.columns" :options="data.options">
  • I figured some answers to that problem which is I also faced. We can't emit object of values at a time, but we can override the vue table -2 state object like, by using the ref attribute can override the request object. By doing this you can send multiple data in a single request. – Arun kumar May 02 '20 at 16:56