[autocomplete] adding element to end of autocomplete list

[autocomplete] adding element to end of autocomplete list

I am using the autocomplete plugin on my website and I wanted to add an element to the end of the of the <div/> that contains the autocomplete list, but only if the list is at it's maximum.  Basically, I just wanted to let the user know that they can refine their search to get more results. 

I have attached a patch of jquery.autocomplete.js where I added my changes.  It's probably only a total of about 10 or 15 lines.  The diff is from a svn repository, so I'm not 100% confident that it will apply smoothly (I don't know if svn adds some headers that are incompatible with the standard `patch` command).  But it should be easy enough to apply by hand.

I also added another css class to jquery.autocomplete.css:

  1. .ac_additional {
  2. margin-top: 0;
  3. text-align: center;
  4. }
This will be the class applied to the element you specify.  You can specify an element in the autocomplete options within your code:

  1. $("#yourInput").autocomplete("snomedSearch", {
  2.                         appendToListElement: $("<p>please refine search terms</p>")
  3. });