When we bind an array of strings to Multiselect and try to filter, it not working
https://codesandbox.io/s/hopeful-sun-u8 ... ctDemo.vue
Multiselect control with filter enabled not filtering
-
- Posts: 560
- Joined: 23 Oct 2020, 09:28
Hi,
With new FilterService, MultiSelect filtering needs to enable filterFields or optionLabel props. If you want to customize your filtering search filterMatchMode prop is available.
Best Regards,
With new FilterService, MultiSelect filtering needs to enable filterFields or optionLabel props. If you want to customize your filtering search filterMatchMode prop is available.
Best Regards,
Could you show an example how to use custom filters on basic array such as provied cities array?tugce.kucukoglu wrote: ↑15 Apr 2021, 13:58Hi,
With new FilterService, MultiSelect filtering needs to enable filterFields or optionLabel props. If you want to customize your filtering search filterMatchMode prop is available.
Best Regards,
Thank you in advance.
I was struggling with this too. In case you haven't found solution yet:
<MultiSelect
v-model="selectedTraders"
:options="newfilteredTraders"
optionLabel="label"
optionGroupLabel="label"
optionGroupChildren="items"
:maxSelectedLabels="1"
:selectionLimit="selectionLimit"
:filter="true"
:filterFields="['label', 'name']"
selectedItemsLabel="{0} Traders"
placeholder="Select traders"
class="multiselect-label mw-100"
:loading="loadingTraders"
loadingIcon="pi pi-spinner pi-spin"
style="max-width: 100%; min-width: 130px"
>
label and name are keys of the dictionary items
<MultiSelect
v-model="selectedTraders"
:options="newfilteredTraders"
optionLabel="label"
optionGroupLabel="label"
optionGroupChildren="items"
:maxSelectedLabels="1"
:selectionLimit="selectionLimit"
:filter="true"
:filterFields="['label', 'name']"
selectedItemsLabel="{0} Traders"
placeholder="Select traders"
class="multiselect-label mw-100"
:loading="loadingTraders"
loadingIcon="pi pi-spinner pi-spin"
style="max-width: 100%; min-width: 130px"
>
label and name are keys of the dictionary items
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests