Skip to content
Permalink
Browse files

Selectmenu; improve HTML building in custom render demo

  • Loading branch information...
fnagel committed Apr 30, 2013
1 parent 7715c71 commit 255d4f6d0a3394102d04bf0e3cdd9bea14c0bf03
Showing with 8 additions and 11 deletions.
  1. +8 −11 demos/selectmenu/custom_render.html
@@ -15,23 +15,20 @@
$(function() {
$.widget( "custom.iconselectmenu", $.ui.selectmenu, {
_renderItem: function( ul, item ) {
var element, span,
var a, span,
li = $( "<li>" );
if ( item.disabled ) {
li.addClass( "ui-state-disabled" ).text( item.label );
} else {
element = item.element;
a = $( "<a>", {
text: item.label,
href: "#"
}).appendTo( li );
span = $( "<span>", {
style: element.attr( "style" ),
"class": "ui-icon " + element.attr( "class" )
});
$( "<a>", {
text: item.label,
href: "#"
})
.append( span )
.appendTo( li );
style: item.element.attr( "style" ),
"class": "ui-icon " + item.element.attr( "class" )
}).appendTo( a );
}
return li.appendTo( ul );

0 comments on commit 255d4f6

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