optimistex / ngx-select-ex

Angular based replacement for select boxes
https://optimistex.github.io/ngx-select-ex/
MIT License
109 stars 42 forks source link

Selected items are added in alphabetical order #130

Closed alotnak closed 5 years ago

alotnak commented 5 years ago

We had version for Angular 4 (it worked with Angular 5.1.2. The newer didn't work at all for us: "TypeError: Object(...) is not a function"). We have import { NgxSelectModule, INgxSelectOptions } from 'ngx-select-ex';

const CustomSelectOptions: INgxSelectOptions = { // Check the interface for more options optionValueField: 'id', optionTextField: 'text' //, keepSelectedItems: true }; If the component is set as multiple, and I select any option, it will be added the way items are in alphabetical order. Demo does not do the same, bit it has no same interface. How to change this? We should only add to the end (and may me ordered with drag and drop, if needed, but it's another issue).

Can I do this with some attribute? Or how? Selected items added in order they are selected?

<ngx-select id="{{obj.id}}" [defaultValue]="defaultValue" [items]="items" (select)="selected($event)" (remove)="removed($event)" (typed)="typed($event)" placeholder="{{placeholder}}" [multiple]="obj.multiple" [disabled]="obj.disabled" autoClearSearch="true" [allowClear]="true"

alotnak commented 5 years ago

Sorry, there was allready issue as Closed.