$.widget( "custom.iconselectmenu", $.ui.selectmenu, {
_renderItem: function( ul, item ) {
var element, span,
- li = $( "<li>" ).data( "ui-selectmenu-item", item );
+ li = $( "<li>" );
if ( item.disabled ) {
li.addClass( "ui-state-disabled" ).text( item.label );
var item,
options = this.element.find( "option" );
-
+
if ( !options.length ) {
return;
}
-
+
this._readOptions( options );
this._renderMenu( this.menu, this.items );
}).appendTo( ul );
currentOptgroup = item.optgroup;
}
- that._renderItem( ul, item );
+ that._renderItemData( ul, item );
});
},
+ _renderItemData: function( ul, item ) {
+ return this._renderItem( ul, item ).data( "ui-selectmenu-item", item );
+ },
+
_renderItem: function( ul, item ) {
- var li = $( "<li>" ).data( "ui-selectmenu-item", item ),
+ var li = $( "<li>" ),
a = $( "<a>", { href: "#" });
if ( item.disabled ) {