Side navigation
#5216 closed enhancement (invalid)
Opened September 14, 2009 05:47PM UTC
Closed October 13, 2009 01:01AM UTC
Last modified November 18, 2012 03:50AM UTC
[autocomplete] Added support for "no results found" text.
Reported by: | dmillz | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.4 |
Component: | unfiled | Version: | 1.3.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi,
I've been working with the very handy jQuery autocomplete plugin, and I added a small bit of functionality that I thought you may be interested in adding to the official release. I added a callback for when there are no results found that match the typed text. The user can specify the text to display by returning a value from the callback, and the callback itself is specified as a parameter to the .autocomplete() call. For example:
$("#textbox").autocomplete("someAjaxPage", {
width: 320,
max: 100,
notFound: function(term) {
return "No items were found starting with \\"" + term + "\\"";
}
});
I've attached the modified jquery.autocomplete.js for your perusal. I'm relatively new to working with jQuery, so any feedback you have is appreciated. The mod works nicely for my purposes, but hasn't yet been tested with all configurations.
I appreciate all the work that's gone into this plugin, and I hope my modification is useful!
Regards,
David Mills
Attachments (1)
Change History (2)
Changed October 13, 2009 01:01AM UTC by comment:1
resolution: | → invalid |
---|---|
status: | new → closed |
Changed November 18, 2012 03:50AM UTC by comment:2
Hello,
i want to use a link along with the "no results" text, but the link is not going anywhere.
Example with hmtl markup: "no results match your query. <a href="somepage.html">Search all instead</a>"
I presume it´s because the "no results" item is selectable by the autocomplete plugin and is overriding my custom href location.
Can you help me ?
Thanks
This is not a jQuery core bug. Please use the jQuery forums or contact the author via the method they request. For jQuery UI plugins, please file a bug on http://dev.jqueryui.com .