aboutsummaryrefslogtreecommitdiffstats
path: root/demos/autocomplete/remote-with-cache.html
diff options
context:
space:
mode:
authorjzaefferer <joern.zaefferer@gmail.com>2010-04-16 11:05:35 +0200
committerjzaefferer <joern.zaefferer@gmail.com>2010-04-16 11:05:35 +0200
commitdbc9addfae0c9a2aee2d4a1833b2b1d3ba83f8de (patch)
tree0bc04f8f3728b660b37655c2166a7648c6574f3c /demos/autocomplete/remote-with-cache.html
parentcddf2a45da7195fadbe17353917cd086831c4313 (diff)
downloadjquery-ui-dbc9addfae0c9a2aee2d4a1833b2b1d3ba83f8de.tar.gz
jquery-ui-dbc9addfae0c9a2aee2d4a1833b2b1d3ba83f8de.zip
Autocomplete: Refactored code for array filtering into $.ui.autocomplete.filter, used by remote-with-cache and modified multiple-demo (now with local data); added multiple-remote to also show multiple with remote data
Diffstat (limited to 'demos/autocomplete/remote-with-cache.html')
-rw-r--r--demos/autocomplete/remote-with-cache.html7
1 files changed, 3 insertions, 4 deletions
diff --git a/demos/autocomplete/remote-with-cache.html b/demos/autocomplete/remote-with-cache.html
index 3688365d4..a00c741e4 100644
--- a/demos/autocomplete/remote-with-cache.html
+++ b/demos/autocomplete/remote-with-cache.html
@@ -22,12 +22,11 @@
source: function(request, response) {
if (cache.term == request.term && cache.content) {
response(cache.content);
+ return;
}
if (new RegExp(cache.term).test(request.term) && cache.content && cache.content.length < 13) {
- var matcher = new RegExp($.ui.autocomplete.escapeRegex(request.term), "i");
- response($.grep(cache.content, function(value) {
- return matcher.test(value.value)
- }));
+ response($.ui.autocomplete.filter(cache.content, request.term));
+ return;
}
$.ajax({
url: "search.php",