Opened 3 years ago

Closed 3 years ago

#15040 closed feature (worksforme)

Cannot customize css of a single autocomplete combobox pull-down list

Reported by: dbeusee Owned by:
Priority: minor Milestone: none
Component: ui.autocomplete Version: 1.12.0
Keywords: Cc:
Blocked by: Blocking:

Description

I have several autocomplete comboboxes on my site, some of which are using a different font. But when the list comes up, it is using the default size which can only be customized with class combobox-context-menu. jquery-ui does not add the name or id of my SELECT element to the list, so I have no way to customize just that list. I would like jquery-ui to add my name and/or id so that I can have custom css for just that list and not all others. Currently it uses something like ui-id-2. I have no way to determine this id. I'd like it to take the id of the SELECT element and add -ui-ul to it (or something like that). So for instance, if I have id="newcc" on my SELECT element, the UL element generated by jquery-ui should use id="newcc-ui-ul".

Change History (2)

comment:1 Changed 3 years ago by Alexander Schmitz

This is what the new classes option is for http://api.jqueryui.com/1.12/autocomplete/#option-classes you can add your own classes to an individual auto complete's elements

comment:2 Changed 3 years ago by Scott González

Resolution: worksforme
Status: newclosed

Yup, this is already possible. This was also possible before the classes option via the widget() method.

http://jsbin.com/maxeqogaqe/edit?html,css,js,output

Note: See TracTickets for help on using tickets.