Skip to content
Permalink
Browse files

Selectmenu: add renderItemData method similar to autocomplete

  • Loading branch information...
fnagel committed Apr 29, 2013
1 parent d4f13bc commit 666927ba916d3f3f90e48677e4884ffd0d7cc398
Showing with 9 additions and 5 deletions.
  1. +1 −1 demos/selectmenu/custom_render.html
  2. +8 −4 ui/jquery.ui.selectmenu.js
@@ -16,7 +16,7 @@
$.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 );
@@ -163,11 +163,11 @@ $.widget( "ui.selectmenu", {

var item,
options = this.element.find( "option" );

if ( !options.length ) {
return;
}

this._readOptions( options );
this._renderMenu( this.menu, this.items );

@@ -235,12 +235,16 @@ $.widget( "ui.selectmenu", {
}).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 ) {

0 comments on commit 666927b

Please sign in to comment.
You can’t perform that action at this time.