select = this.element.hide(),
selected = select.children( ":selected" ),
value = selected.val() ? selected.text() : "";
- var input = $( "<input>" )
+ var input = this.input = $( "<input>" )
.insertAfter( select )
.val( value )
.autocomplete({
.appendTo( ul );
};
- $( "<button> </button>" )
+ this.button = $( "<button> </button>" )
.attr( "tabIndex", -1 )
.attr( "title", "Show All Items" )
.insertAfter( input )
input.autocomplete( "search", "" );
input.focus();
});
+ },
+
+ destroy: function() {
+ this.input.remove();
+ this.button.remove();
+ this.element.show();
+ $.Widget.prototype.destroy.call( this );
}
});
})( jQuery );