Hide the filter by default and on the page for selecting a page and defining one new filter "manual_agent".
optionsTable: { customFilters: ['manual_agent'], filterable: false, perPageValues: [] },
Hiding because there is no 'slot' option to be able to add new custom filters between one by default and page selection, and one by default is also not too responsive. The following is an example implementation of a server table.
Method to be used globally for custom filters:
toggleFilter: function(filterName, $event) { this.$refs.serverTableRef.setPage(1); setTimeout(function () { let searchItem = ''; if (typeof $event === 'string') { searchItem = $event; } else { searchItem = $event.target.value; } let table = this.$refs.serverTableRef; table.customQueries[filterName] = searchItem; table.getData(); }.bind(this), 1000); }
For this to work, we must define ref ref in our v-server table as follows:
<v-server-table ref="serverTableRef"
Now in the template there is a new user selection filter (the v-model simply points to the user variable defined in the data)
<select name="typeoftrip" v-model="agentFilter" @change="toggleFilter('manual_agent', agentFilter)">
And a custom filter that will replace the default filter that we lost by disabling it. (he used the name "query", so we use the same thing)
<input name="typeoftrip" v-model="mainQuery" v-on:keyup="toggleFilter('query', mainQuery)">
And a new custom choice for our own on the selection page
<select v-model="limitFilter" @change="$refs.serverTableRef.setLimit($event.target.value)" > <option value="10">10</option> <option value="25">25</option> <option value="50">50</option> </select>