From 5c55462a9024351f3c6084ea2ec862a19cba5b67 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Thu, 15 Apr 2010 10:43:47 +0200 Subject: Autocomplete: multiple demo added --- demos/autocomplete/index.html | 1 + demos/autocomplete/multiple.html | 75 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 demos/autocomplete/multiple.html (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/index.html b/demos/autocomplete/index.html index 42f13dc4b..0c92d19b4 100644 --- a/demos/autocomplete/index.html +++ b/demos/autocomplete/index.html @@ -17,6 +17,7 @@
  • Custom data and display
  • XML data parsed once
  • Categories
  • +
  • Multiple values
  • diff --git a/demos/autocomplete/multiple.html b/demos/autocomplete/multiple.html new file mode 100644 index 000000000..5fef4bad2 --- /dev/null +++ b/demos/autocomplete/multiple.html @@ -0,0 +1,75 @@ + + + + + jQuery UI Autocomplete multiple demo + + + + + + + + + + + +
    + +
    + + +
    + +
    + +
    +

    +Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names. +

    +

    +This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field. +

    +
    + + + -- cgit v1.2.3 From cddf2a45da7195fadbe17353917cd086831c4313 Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Thu, 15 Apr 2010 15:31:49 +0200 Subject: Autocomplete: code improvements for multiple demo --- demos/autocomplete/multiple.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/multiple.html b/demos/autocomplete/multiple.html index 5fef4bad2..5e0f4b50b 100644 --- a/demos/autocomplete/multiple.html +++ b/demos/autocomplete/multiple.html @@ -16,7 +16,7 @@ return val.split(/,\s*/); } function extractLast(term) { - return split(term)[split(term).length - 1]; + return split(term).pop(); } $("#birds").autocomplete({ @@ -27,7 +27,7 @@ }, search: function() { // custom minLength - var term = extractLast($(this).val()); + var term = extractLast(this.value); if (term.length < 2) { return false; } @@ -37,14 +37,14 @@ return false; }, select: function(event, ui) { - var terms = split( $(this).val() ); + var terms = split( this.value ); // remove the current input terms.pop(); // add the selected item terms.push( ui.item.value ); // add placeholder to get the comma-and-space at the end terms.push(""); - $(this).val( terms.join(", ") ); + this.value = terms.join(", "); return false; } }); -- cgit v1.2.3 From dbc9addfae0c9a2aee2d4a1833b2b1d3ba83f8de Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Fri, 16 Apr 2010 11:05:35 +0200 Subject: 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 --- demos/autocomplete/index.html | 1 + demos/autocomplete/multiple-remote.html | 75 +++++++++++++++++++++++++++++++ demos/autocomplete/multiple.html | 22 ++++----- demos/autocomplete/remote-with-cache.html | 7 ++- ui/jquery.ui.autocomplete.js | 12 ++--- 5 files changed, 94 insertions(+), 23 deletions(-) create mode 100644 demos/autocomplete/multiple-remote.html (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/index.html b/demos/autocomplete/index.html index 0c92d19b4..c7b720784 100644 --- a/demos/autocomplete/index.html +++ b/demos/autocomplete/index.html @@ -18,6 +18,7 @@
  • XML data parsed once
  • Categories
  • Multiple values
  • +
  • Multiple, remote
  • diff --git a/demos/autocomplete/multiple-remote.html b/demos/autocomplete/multiple-remote.html new file mode 100644 index 000000000..5e0f4b50b --- /dev/null +++ b/demos/autocomplete/multiple-remote.html @@ -0,0 +1,75 @@ + + + + + jQuery UI Autocomplete multiple demo + + + + + + + + + + + +
    + +
    + + +
    + +
    + +
    +

    +Usage: Enter at least two characters to get bird name suggestions. Select a value to continue adding more names. +

    +

    +This is an example showing how to use the source-option along with some events to enable autocompleting multiple values into a single field. +

    +
    + + + diff --git a/demos/autocomplete/multiple.html b/demos/autocomplete/multiple.html index 5e0f4b50b..908cfe6ce 100644 --- a/demos/autocomplete/multiple.html +++ b/demos/autocomplete/multiple.html @@ -12,6 +12,7 @@ -- cgit v1.2.3 From 6a59746d1d97cb24bafe50c1434d9398be9c7585 Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 21 Apr 2010 10:02:53 -0400 Subject: Autocomplete: Added demo for accent folding. Proof of concept for #5219 - Autocomplete: Support for accent-folding. --- demos/autocomplete/folding.html | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 demos/autocomplete/folding.html (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/folding.html b/demos/autocomplete/folding.html new file mode 100644 index 000000000..d5bc71e9d --- /dev/null +++ b/demos/autocomplete/folding.html @@ -0,0 +1,64 @@ + + + + + jQuery UI Autocomplete Accent Folding Demo + + + + + + + + + + + +
    + +
    +
    + + +
    +
    + +
    + +
    +

    +The autocomplete field uses a custom source option which will match results that have accented characters even when the text field doesn't contain accented characters. However if the you type in accented characters in the text field it is smart enough not to show results that aren't accented. +

    +

    +Try typing "Jo" to see "John" and "Jörn", then type "Jö" to see only "Jörn". +

    +
    + + + -- cgit v1.2.3