Hello,

For a project I am working on I've successfully implemented the
autocompleter (http://docs.jquery.com/Plugins/Autocomplete) and
although it works like a charm, I would like to give the results a
different markup. Currently, all rows are displayed as LI elements
which makes perfect sense, but I would like to group my results in
rows and columns (like a TABLE). (I understand this wish is not only a
matter of different markup).

A live example to illustrate what I would like to have can be viewed
at http://www.last.fm/. At the top right of the homepage appears a
search box ('try our new search'), and when you start typing there
(let's say 'melvin'), the results are grouped by artists and albums
(other groups are 'tags' and 'tracks'). Handy!

I have been searching for additions (autocomplete+table) to what seems
to be the 'official' autocomplete plugin but without success. Also,
from reading the specifications, it seems the markup is not tweakable
via the API.

So my questions are: is it possible to return the suggestions as
grouped rows with the current plugin? Is it possible to change the
markup from an unordered list (UL) to a table (TABLE)? I think not but
I like to think other people have experimented with this already :-)
And if not, maybe it would be a cool and welcome future feature?

What I could do for now though is to fake a table by grouping the
returned suggestions and some CSS tweaks, so the data would look like
this:

> suggestion A (artist)
> suggestion B (artist)
> suggestion C (album)
> suggestion D (album)
> suggestion E (album)

and then using CSS I could display these suggestions as follows:

artist         suggestion A
                suggestion B
                suggestion C
album       suggestion D
                suggestion E

(I hope this looks somewhat OK in a non-fixed width font)

Any tips, hints, remarks on above exmaple, and especially links to
working demo's that cover perfectly what I want will be highly
appreciated!

Thanks in advance,
Maarten

Reply via email to