isteven / angular-multi-select

A multi select dropdown directive for AngularJS. Allows you to use HTML tags and CSS in the data. Requires only AngularJS and nothing else.
isteven.github.io/angular-multi-select
MIT License
1.08k stars 518 forks source link

Multilanguage Search Support or Override Search Results #463

Closed jjerrythimothy closed 7 years ago

jjerrythimothy commented 8 years ago

I have a requirement:

Consider there are 3 names:

  1. Alfredo
  2. Pérez
  3. Perez

When I type Pérez in the search input box, I need to list down:

  1. Pérez
  2. Perez regardless of the language, I need to display something like the above.

OR

If I try to manipulate the search using javascript, I need to know whether there is an ability to override my search results with my result.

Thanks in advance... :)

T89L commented 8 years ago

I'd take a look at the $scope.updateFilter function. You could do your required manipulation there.

isteven commented 8 years ago

Hi @jjerrythimothy

This is a valid challenge, and rather useful indeed. However, unfortunately I have no experience nor usage of such international characters.

Tim is correct, $scope.updateFilter handles the filtering process. You can put some logic to process or "translate" those characters.

Just remember to do so as early as possible (for example, do it BEFORE the $scope.updateFilter is called). This can save some processing power.

jjerrythimothy commented 8 years ago

Hi @isteven @tim-lukacik

That is a bower component and I do not have control over it in the live environment. npm just imports from github during deployment.

I have tried many ways to override the function through angular directive inheritance but not successful because the multi-select is the child directive.

Is there any way possible to block the $scope.updateFilter from running? so that I could use my manipulation in on-search-change.