indrimuska / angular-selector

A native AngularJS directive that transform a simple <select> box into a full html select with typeahead.
http://indrimuska.github.io/angular-selector
MIT License
96 stars 36 forks source link

Custom filter and sorting #25

Open C00per opened 8 years ago

C00per commented 8 years ago

Hi!

  1. Is it possible to add the custom filter and sorting capability for the array in the "options" parameter?
  2. Could you please explain how current filtering is working? It seems that used all fields for objects in the array in the "options" parameter, so objects without entered symbols are shown.
  3. Is it possible to highlight entered sybmols that used for filtering?
indrimuska commented 8 years ago

Hi @C00per. At the moment filtering works with the native angular $filter service over the entire object. It would be very nice if users could be define a custom filtering function, are you interested in making a PR?

Regarding symbols highlighting, I don't have a solution to perform that action, since every user can define its own template for dropdown items. Maybe it can be done with a filter, but I'm not sure about that.

C00per commented 8 years ago

Hi @indrimuska. I'm sorry, but I'm not enough qualified to make a PR (.

Custom filtering and sorting are useful features that allow use selector with complex objects. For now, I have to create the special array with simplified copies as a workaround.

But anyway angular-selector works as expected so I'm trying to migrate to it from buggy ui-selector.

indrimuska commented 8 years ago

Ok, maybe custom filtering function could be one of the next features :)