Topic: Select custom filter function

Lumpenstein free asked 2 years ago


Expected behavior

I want to be able to provide my own filter function like it was possible in MDB4.

  • I need to use a 'startsWith' filter instead of 'contains'

  • I need to filter not only by the option label, but 'secondary values' as well, but I do not want those values to show up in the drowdown or the 'selected value input'.

Actual behavior

  • Not possible to use startsWith filter

  • If I use the secondary values (and hide them in the dropdown) the 'selected value input' shows ${value} ${secondaryvalue}. If I add [label] to the option, then the secondary values are no longer filterable.

Example:

A multi select for countries. I want only to show countrynames, but being able to filter by their ISO3 code ('USA', 'FRA', ...) as well as the name. The only way to archieve that ATM is by using secondary values, but then upon selecting one, it shows 'Germany DEU' instead of only 'Germany'.


Grzegorz Bujański staff answered 2 years ago


Thanks for your request. We will discuss this in the team and consider adding these options.

For now, you can consider to using autocomplete: https://mdbootstrap.com/docs/angular/forms/autocomplete/#section-custom-item


Lumpenstein free commented 2 years ago

I need a mutliselect unfortunately.

Edit: Even just predefined functions would be fine ([filterBy]="Filters.startWith" [filterSecondaryValues]="true")



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: Yes
  • Provided link: No