How to disable jquery-ui (widget) for a specific element?

171 views Asked by At

I use Jquery-UI and accordingly the selectmenu-widget in my project. Can I disable the widget for a specific element, so that the select look and functionality returns to native?

I tried solutions mentioned in Jquery disable theming for a specific element but without success. data-role: none is not doing any change, and I can't simply remove ui-classes because the widget creates a whole new element which acts like a proxy for the select and so the select itself does not have any classes.

Any help would be appreciated.

1

There are 1 answers

1
leachim On

I solved it by manually destroying the selectmenu-element and displaying the initial element again at documentReady().

I would be glad to hear about a better solution since this one is hacky and involves problems, e.g. at responsiveness if the element should be displayed just at a specific screen size, you have to handle it again manually in your function where you render the initial element back.