Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order results when using typeahead from ngx-bootstrap? #4808

Closed
i1990jain opened this issue Nov 15, 2018 · 5 comments · Fixed by #5646
Closed

Order results when using typeahead from ngx-bootstrap? #4808

i1990jain opened this issue Nov 15, 2018 · 5 comments · Fixed by #5646

Comments

@i1990jain
Copy link

i1990jain commented Nov 15, 2018

I am using customTemplate for my typeahead which has three fields

({{model.number}}-{{model.city}}-{{model.state}})

using the number as the typeaheadOptionField, I see there is typeaheadGroupField available which I use on the number field .... I would like to know is there anyway in which I can order the result based on the city field?

<ng-template #customCapTemplate let-model="item" let-index="index">
   <h5>{{model.code}}-{{model.city}}-{{model.prov}}</h5>
</ng-template>
<input name="colCap" [typeahead]="capList" typeaheadGroupField="code" 
    typeaheadOptionField="code" [typeaheadItemTemplate]="customCapTemplate" class="form-control">

screen shot 2018-11-15 at 12 43 20

@KenrySanchez
Copy link

Hello @i1990jain, I have the same problem with my development. Can you tell me how did you solve the problem?

@IraErshova
Copy link
Contributor

@i1990jain Hi! Do you mean you want to search by number and by the city at the same time?

@IraErshova
Copy link
Contributor

IraErshova commented Feb 5, 2020

I created a stackblitz example for this case. @i1990jain you can use it
https://stackblitz.com/edit/angular-gzssfc

@i1990jain
Copy link
Author

@i1990jain Hi! Do you mean you want to search by number and by the city at the same time?

search just by the number but then the results must be order by the name of the city

@IraErshova IraErshova self-assigned this Feb 5, 2020
@IraErshova
Copy link
Contributor

@i1990jain Hi! Do you mean you want to search by number and by the city at the same time?

search just by the number but then the results must be order by the name of the city

Oh, I got it! Thanks for clarification

@IraErshova IraErshova added the WIP label Feb 5, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 6, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 6, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 6, 2020
@IraErshova IraErshova removed the WIP label Feb 6, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 6, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 7, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 7, 2020
IraErshova added a commit to IraErshova/ngx-bootstrap that referenced this issue Feb 12, 2020
daniloff200 added a commit that referenced this issue Feb 12, 2020
Add sort functionality to typeahead

Close #4808

Co-authored-by: Dmitriy Danilov <daniloff200@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants