浏览代码

Render formatNoMatches when all ajax results are selected #381

Julian Krispel-Samsel 12 年之前
父节点
当前提交
9d06fe24dc
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      select2.js

+ 5 - 0
select2.js

@@ -2592,6 +2592,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