Bug Tracker

Ticket #3268 (new feature)

Opened 3 months ago

Last modified 3 months ago

[autocomplete] added dropdown button support, setData function, "n results omitted" message support

Reported by: jkytomak Assigned to: anonymous
Type: feature Priority: minor
Milestone: 1.3 Component: plugin
Version: 1.2.6 Keywords: autocomplete
Cc: Needs: Review

Description

I added some features to the autocomplete 1.0.2 component that were needed by my project. The features are:

"Dropdown button"

If option dropdownImgSrc is given, the image defined by it will be inserted next to the input field that, when clicked, will open the autocomplete result list with empty search params. Makes autocomplete more usable when the input might only hold few items but might hold many as well.

setData function

Function to reset the local data used by Autocomplete if it needs to be updated after initialization.

"N results omitted" message support

Autocomplete only shows options.max items on the result list, even if there are more results. This may be confusing in some cases, as there is no cues that some results are missing from the list. Added option omittedResultsMsg that, if defined and results > options.max, will be shown in the bottom of the autocomplete list. For example

omittedResultsMsg: "({0} results omitted - refine your search)"

will show message e.g. "(50 results omitted - refine your search)".

Attachments

autocomplete-mod.zip (26.5 kB) - added by jkytomak 3 months ago.

Change History

Changed 3 months ago by jkytomak

Changed 3 months ago by jkytomak

Sorry, added this ticket twice by accident. Please remove #3267.

Note: See TracTickets for help on using tickets.