Skip to main content

Bug Tracker

Side navigation

#4485 closed enhancement (invalid)

Opened April 03, 2009 09:17AM UTC

Closed October 13, 2009 12:00AM UTC

[autocomplete] enhancement: new function to show all values even when the input contains a value already

Reported by: mephiztophelez Owned by:
Priority: minor Milestone:
Component: plugin Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:
Description

Problem Description

We had the requirement to show a link next to the input field like "show options". When clicking this link the autocomplete input field should show the drop down with all the available values.

That functionality is already there, but only if the input field is empty and you click/focus/keydown/keyup it.

But if there is already a value inside the input field then the dropdown only shows that filled value or other values which match the current value (depending on some options).

But what we want is that even something is filled in already, that you see the complete list.

Solution / Proposal

I have solved this by a minor enhancement to the jquery.autocomplete.js file.

I have created a new function showAllValues on the $AutoCompleter object which can be called on an HTML Element

e.g.

var inputFieldAutocompleter = $("#myInputField").autocomplete([value1, value2, value3], { matchContains: true, minChars: 0, delay: 1, scroll:true });

$("#myShowOptionsLinkWhichShowsAllValues").click(	function(){
															## call the new showAllValues function which shows all values even though there is already a value filled in the input field 
															inputFieldAutocompleter.showAllValues();
														});

I will attach the enhancement as a patch for discussion.

Would be great if something like that could make it into the next release of the autocomplete plugin.

Thanks

Christoph

Attachments (1)
Change History (1)

Changed October 13, 2009 12:00AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

This is not a jQuery core bug. Please report plugin bugs to the plugin's author, or ask on the jQuery forums. jQuery UI bugs should be reported on the UI bug tracker, http://dev.jqueryui.com .