prime
prime

Reputation: 15574

How to destroy the jQuery UI combobox functionality and get the original behaviour

I'm using this jquery-ui-combobox in my application. And there is no way specified to destroy the combo box functionality. Is there a way to do it ?

Upvotes: 1

Views: 1535

Answers (2)

prime
prime

Reputation: 15574

I solved this by using a part of a comment in that article. It's to add a customized destroy functionality, and it works fine.

    destroy: function() {
        this.wrapper.remove();
        this.button.remove();
        this.element.show();
        $.Widget.prototype.destroy.call( this );
    }

Then call it by,

element.combobox('destroy');

Upvotes: 2

Fayyaz Naqvi
Fayyaz Naqvi

Reputation: 763

Since this is a custom implementation of jQuery UI Autocomplete, you could call the destroy() method, something like this:

if (input.autocomplete("widget").is(":visible")) {
    input.autocomplete("destroy"); 
}

http://api.jqueryui.com/autocomplete/#method-destroy

Upvotes: 1

Related Questions