Browse Source

Merge pull request #1247 from juliankrispel/master

Display formatNoMatches when all ajax results are selected
Igor Vaynberg 12 years ago
parent
commit
26f41602b2
1 changed files with 5 additions and 0 deletions
  1. 5 0
      select2.js

+ 5 - 0
select2.js

@@ -2695,6 +2695,11 @@ the specific language governing permissions and limitations under the Apache Lic
                 self.highlight(0);
             }
 
+            //If all results are chosen render formatNoMAtches
+            if(!this.opts.createSearchChoice && !choices.filter('.select2-result:not(.select2-selected)').length > 0){
+                this.results.append("<li class='select2-no-results'>" + self.opts.formatNoMatches(self.search.val()) + "</li>");
+            }
+
         },
 
         // multi