@@ -203,6 +203,46 @@ _renderMenu: function( ul, items ) {
203
203
_resizeMenu: function() {
204
204
this.menu.outerWidth( 500 );
205
205
}
206
+ ]]> </code >
207
+ </example >
208
+ </method >
209
+ <method name =" _renderButtonItem" return =" jQuery" >
210
+ <desc >
211
+ <p >Method that controls the creation of the generated button content. The method must create and return a new element.</p >
212
+ </desc >
213
+ <argument name =" item" type =" Object" >
214
+ <property name =" disabled" type =" Boolean" >
215
+ <desc >Whether the item is disabled.</desc >
216
+ </property >
217
+ <property name =" element" type =" jQuery" >
218
+ <desc >A reference to the item's original <code >< option> </code > element.</desc >
219
+ </property >
220
+ <property name =" index" type =" Number" >
221
+ <desc >The numeric index of the item.</desc >
222
+ </property >
223
+ <property name =" label" type =" String" >
224
+ <desc >The string to display for the item.</desc >
225
+ </property >
226
+ <property name =" optgroup" type =" String" >
227
+ <desc >If the item is within an <code >< optgroup> </code >, this is set to that <code >< optgroup> </code >'s label.</desc >
228
+ </property >
229
+ <property name =" value" type =" String" >
230
+ <desc >The <code >value</code > attribute of the item's original <code >< option> </code >.</desc >
231
+ </property >
232
+ </argument >
233
+ <example >
234
+ <desc >Style the button background color based on the value of the selected option.</desc >
235
+ <code ><![CDATA[
236
+ _renderButtonItem: function( item ) {
237
+ var buttonItem = $( "<span>", {
238
+ "class": "ui-selectmenu-text"
239
+ })
240
+ this._setText( buttonItem, item.label );
241
+
242
+ buttonItem.css( "background-color", item.value )
243
+
244
+ return buttonItem;
245
+ }
206
246
]]> </code >
207
247
</example >
208
248
</method >
0 commit comments