'Using Selectpicker for filter-control

I am using bootstrap-select in a <select> that serves as a filter-control component of a bootstrap table.

I want to use this select to filter via various types of cars, not only one.

I have everything working but, when I select one or more types of cars, this error shows up in the browsers' console:

Uncaught TypeError: a.trim is not a function

It is retrieving the error from the bootstrap-table script:

https://unpkg.com/[email protected]/dist/extensions/filter-control/bootstrap-table-filter-control.min.js:10

Might it be that it is returning an array while the script wants a string? (Arrays do not have a trim function). In that case, can I patch it so it returns a joined array? It does not seem to be the case since the error is thrown even if I change the value like this:

let stringVal = multiSelect.val().join()
multiSelect.val(stringVal)

Any advice would be appreciated.


BTW, this can also be applied to simple input filters, could I find by more than one criteria in that case?

Like what combination of chars should I insert in the search input so it looks for those two? Is this even possible?

Example(s)

sedan|coupe sedan&coupe sedan,coupe sedan, coupe



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source