I want my primeng multiselect to have a search/filter input, which I added via
<p-multiselect [filter]="'true'" [options]="selectOptions"></p-multiselect>
. And when user type value in filter input, I get new data with api, and refresh selectOptions. But p-multiselect is doing filter on my options, and shows options without some items.
Tell me please how can I have that filter input, without dafault filter function?
Now I just refresh that options data, but I dont get the result I wont
2
Answers
You need to use
AutoComplete
functionality to achieve this. https://primeng.org/autocomplete.multiselect
only allows you to filter through the data you have already set to the dropdownYou can do that by adding input filed with
formControl
inside thepTemplate="header"
of the component like so:In html:
make sure to disable the default filter by adding
[filter]="false"
Now inside your TS: