From f5619df49346f35443a864bf603bd9107fdd743b Mon Sep 17 00:00:00 2001 From: Alan Devlin Date: Sun, 17 Jan 2016 11:39:01 +0100 Subject: [PATCH] Add showNoResults option Whether to show "No Records." message when there are no matching results. Setting this to false can help when selectFirst is true and mustMatch is false. --- docs/subs/autocomplete_options.html | 1 + jquery.autocomplete.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/subs/autocomplete_options.html b/docs/subs/autocomplete_options.html index 403cb1a..91fb500 100644 --- a/docs/subs/autocomplete_options.html +++ b/docs/subs/autocomplete_options.html @@ -333,6 +333,7 @@

From jQuery JavaScript Library

scrollBooleanDefault: true Whether to scroll when more results than configured via scrollHeight are available. scrollHeightNumberDefault: 180height of scrolled autocomplete control in pixels selectFirstBooleanDefault: trueIf this is set to true, the first autocomplete value will be automatically selected on tab/return, even if it has not been handpicked by keyboard or mouse action. If there is a handpicked (highlighted) result, that result will take precedence. + showNoResultsBooleanDefault: trueWhether to show "No Records." message when there are no matching results. Setting this to false can help when selectFirst is true and mustMatch is false. widthNumberDefault: width of the input elementSpecify a custom width for the select box.


diff --git a/jquery.autocomplete.js b/jquery.autocomplete.js index 497a80a..303fac5 100644 --- a/jquery.autocomplete.js +++ b/jquery.autocomplete.js @@ -22,7 +22,7 @@ $.fn.extend({ data: isUrl ? null : urlOrData, delay: isUrl ? $.Autocompleter.defaults.delay : 10, max: options && !options.scroll ? 10 : 150, - noRecord: "No Records." + noRecord: options && options.showNoResults ? "No Records." : "" }, options); // if highlight is set to false, replace it with a do-nothing function