A
A
Ayan Bai2016-05-18 16:16:45
Angular
Ayan Bai, 2016-05-18 16:16:45

How to group dropdown list results on typehead?

In a previous question , I was pulling results from two sources and displaying them in a dropdown list. Now faced with another task, without it, the meaning of implementing such a drop-down list is lost.
Now I can't make a grouping of the drop-down list, here I made a drop- U4cUwye.png
down list of clients on angular ui-select , and I made a list of addresses on typehead , since ui-select loads data before initialization, it did not suit me.
Typehead solves all my problems, but it does not have grouping. The documentation describes the typeahead-template-url and typeahead-popup-template-url parameters if you want to use your own display.
Herethere is also an example of grouping implementations based on these parameters.
But, I still couldn't implement it.
Here is my markup

<div class="form-group">
          <input type="text" ng-disabled="order.client === null" ng-model="order.direction.from" placeholder="Введите адрес подачи..." uib-typeahead="address.place.address for address in getTarifZones($viewValue)" typeahead-loading="loadingLocationsFrom" typeahead-no-results="noResultsFrom" typeahead-editable="true" class="form-control">
            <i ng-show="loadingLocationsFrom" class="glyphicon glyphicon-refresh"></i>
            <div ng-show="noResultsFrom">
              <i class="glyphicon glyphicon-remove"></i> Ничего не найдено
            </div>
        </div>

Any ideas?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question