From 1c3ea9b91116aaa3e37158e22925bec1aac8a089 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Mon, 5 Apr 2010 11:07:55 -0700 Subject: Added link to categories-demo to autocomplete demos index. Still need to move the menu-overrides from that demo back to menu (is there a ticket?). --- demos/autocomplete/index.html | 1 + 1 file changed, 1 insertion(+) (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/index.html b/demos/autocomplete/index.html index 9389b076d..828a39489 100644 --- a/demos/autocomplete/index.html +++ b/demos/autocomplete/index.html @@ -16,6 +16,7 @@
  • Combobox
  • Custom data and display
  • XML data parsed once
  • +
  • Custom rendering with categories
  • -- cgit v1.2.3 From 34a71eab7bf64f7e2586e087425ed6fe56ceb058 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 6 Apr 2010 22:42:14 +0200 Subject: Autocomplete: Change demo title in index.file to fit it in one line --- demos/autocomplete/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/index.html b/demos/autocomplete/index.html index 828a39489..42f13dc4b 100644 --- a/demos/autocomplete/index.html +++ b/demos/autocomplete/index.html @@ -16,7 +16,7 @@
  • Combobox
  • Custom data and display
  • XML data parsed once
  • -
  • Custom rendering with categories
  • +
  • Categories
  • -- cgit v1.2.3 From ffc29bba052e4bc8b84e4c2e16036140148b6f9c Mon Sep 17 00:00:00 2001 From: jzaefferer Date: Thu, 8 Apr 2010 12:07:45 +0200 Subject: Autocomplete: Combobox demo update, fixed mustMatch with corrected change event, also added button for toggling the hidden select and an empty-value option. Fixes #5453 --- demos/autocomplete/combobox.html | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'demos/autocomplete') diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index 4c6b656a1..3001f7d17 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -30,24 +30,23 @@ var matcher = new RegExp(request.term, "i"); response(select.children("option").map(function() { var text = $(this).text(); - if (!request.term || matcher.test(text)) + if (this.value && (!request.term || matcher.test(text))) return { - id: $(this).val(), + id: this.value, label: text.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + $.ui.autocomplete.escapeRegex(request.term) + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "$1"), value: text }; })); }, delay: 0, - select: function(e, ui) { + change: function(event, ui) { if (!ui.item) { // remove invalid value, as it didn't match anything $(this).val(""); return false; } - $(this).focus(); select.val(ui.item.id); - self._trigger("selected", null, { + self._trigger("selected", event, { item: select.find("[value='" + ui.item.id + "']") }); @@ -56,6 +55,7 @@ }) .addClass("ui-widget ui-widget-content ui-corner-left"); $("") + .attr("tabIndex", -1) .attr("title", "Show All Items") .insertAfter(input) .button({ @@ -81,7 +81,10 @@ })(jQuery); $(function() { - $("select").combobox(); + $("#combobox").combobox(); + $("#toggle").click(function() { + $("#combobox").toggle(); + }); }); @@ -91,7 +94,8 @@
    - + @@ -107,6 +111,7 @@
    + -- cgit v1.2.3