Question

So I'm using the jquery selectmenu but one of the parameters does not seem to be working. It's called "transferClasses" and according to the filamentgroup page this parameter is supposed to allow me to transfer css classes from the select tag to the selectmenu.
(http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select)

transferClasses: true, transfer classes from select

It no worky.

According to github this option has been removed and it says to use widget instead. (https://github.com/fnagel/jquery-ui/wiki/Selectmenu)

transferClasses: Transfer classes from select (removed in latest version, use widget method instead)

The problem is, the documentation is very minimalist and does not explain how to use the widget method to add classes.

widget

Returns the button link and the menu list (ul). Useful to add additional CSS classes.

$('select#speedA').selectmenu("widget")

Anybody have any idea?

Was it helpful?

Solution

The widget method works according to all jQuery UI Widgets, please see: http://api.jqueryui.com/jQuery.widget/#method-widget

There is a usage example in the default demo, please see: https://github.com/fnagel/jquery-ui/blob/selectmenu/demos/selectmenu/default.html#L33

Use .filter() if you need to apply classes to only one, the button or the menu.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top