Bug Tracker

Opened 11 years ago

Closed 10 years ago

#4444 closed enhancement (invalid)

[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]);

Change History (1)

comment:1 Changed 10 years ago by dmethvin

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 .

Note: See TracTickets for help on using tickets.