I have got a problem. I am applying the widget on select
element. When I am reloading the same select
element values, I am removing the widget on the select
element and reapplying. But while reapplying the widget on the same element, the changes are not reflecting.
Below is the HTML select statement:
<select id="countries" class="multiselect" multiple="multiple" name="countries">
<option value="USA">United States</option>
...
</select>
To apply the widget on the same element:
function applyWidget(){
$(".multiselect").multiselect();
}
Once the widget is applied, it is creating a div
with class=".ui-multiselect"
.
To remove the widget class:
function removeWidget(){
$(".ui-multiselect").remove();
}
Calling the applyWidget()
method for the first time is working fine. Calling the second time is not working. How do I reload the widget on the element?