P
P
PetrTar2019-06-11 12:52:51
Bootstrap
PetrTar, 2019-06-11 12:52:51

How to set filter in bootstrap-vue table?

I have a table on bootstrap-vue with parameters

<b-table striped hover
            :items="mainAcciunt"
            :fields="fields"
            :filter-function="filterOpt"
            :current-page="currentPage"
            :per-page="perPage"
            :sort-by.sync="sortBy"
            :sort-desc.sync="sortDesc"
            :fixed="fixed"
            @filtered="onFiltered"
            >
, I want to filter the data using the filterOpt function, how do I call this function when changing the parameters with which the function will compare the values ​​in the table?
For example, I have a select:
<b-form-select :options="debetOptions" v-model="filterDebet" class="mb-1"/>

And when it changes, the values ​​in the rows of the table would be compared with the value of the select.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-06-11
@PetrTar

Why not read the documentation ? Everything is written there. Pass filterDebet as the value of the filter parameter to the table: :filter="filterDebet".
UPD. Taken from the comments:

I want to filter by multiple values

No problem - pass an object that will contain these values. For example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question