From 9d06fe24dc93473e9a13c12bf2c7dad144b5b799 Mon Sep 17 00:00:00 2001 From: Julian Krispel-Samsel Date: Sat, 4 May 2013 08:03:00 +0100 Subject: [PATCH] Render formatNoMatches when all ajax results are selected #381 --- select2.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/select2.js b/select2.js index 04af1cfa..46253d4e 100644 --- a/select2.js +++ b/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("
  • " + self.opts.formatNoMatches(self.search.val()) + "
  • "); + } + }, // multi