"No results" for select2 theme
select2 supports displaying of a message when there aren't any results. I'm working on a patch to enable this.
`
``
+1
Check https://github.com/angular-ui/ui-select/issues/152 for possible solution, let me know your opinion
Until #152 gets added, I'm using the filter from http://stackoverflow.com/a/23452217/1921234.
When we get nothing back from the server I add {text: "No Results...", id: ''} to the options.
And I added this line at the beginning of the filter so it will show up.
if(input.length == 1 && input[0].text == 'No Results...') return input;
+1 to this. I'm going to have to see if I can wrap something around the ui-select directive in order to support this throughout my application. It would be great if there was a directive under the ui-select directive that I could define.
+1
+1
Alternatively
<ui-select>
<ui-select-match>
{{$select.selected}}
</ui-select-match>
<ui-select-choices repeat="option in options | filter: $select.search" refresh="refreshOptions($select.search)" refresh-delay="500">
<div ng-bind-html="option | highlight: $select.search"></div>
</ui-select-choices>
</ui-select>
<div class="text-warning" ng-if="options.length == 0">Nothing found</div>
@fabiopaiva your solution would work only if the options are empty, not when the user search filter makes them empty...+1 for a real solution
@nadavsinai then you shouldn't use a filter but instead do the filtering in your refresh function.
@nadavsinai The real solution is always the best
Closing due to the age of the issue - if this is still a problem, please open a new issue with adequate reproduction in Plunker.