Skip to main content

Bug Tracker

Side navigation

#4444 closed enhancement (invalid)

Opened March 29, 2009 08:43AM UTC

Closed October 13, 2009 01:19AM UTC

[autocomplete] change background depending on item

Reported by: uyuni Owned by:
Priority: minor Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: autocomlete, background Cc:
Blocked by: Blocking:
Description

I'd like to have a different background for items.

I added some code. The function formatItem now returns an object with 2 elements: the formatted item and the style of the LI.

changed code from line 645:

var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);

if ( formatted === false )

continue;

// changed Emile Schenk 2009-03-29

if(typeof(formatted) == 'object') {

liStyle = "style='" + formatted.liStyle + "'";

formatted = formatted.item;

}

else {

liStyle = '';

}

var li = $("<li "+liStyle+" />").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];

// end changed Emile Schenk 2009-03-29

$.data(li, "ac_data", data[i]);

Attachments (0)
Change History (1)

Changed October 13, 2009 01:19AM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

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 .