问题
Just trying to use multiselect.js for multiple type select input's
Here is what select
looks like
<select multiple="multiple" id="my-select" name="my-select[]">
<option value='elem_1'>elem 1</option>
</select>
Using multiselect like this -
var s = $('#my-select');
s.multiSelect({
selectableHeader: "<div class='custom-header'>Options</div>",
selectionHeader: "<div class='custom-header'>Selected</div>"
});
Here is what it looks like -->
http://jsfiddle.net/6k8gW/5/
This work's fine until i try to add new option
s.append($('<option />').text("new").val("value"));
s.multiSelect('refresh');
And the output is like this -->
http://jsfiddle.net/6k8gW/6/
Why refresh
is not working properly ?
回答1:
It's indeed a bug. I submitted a patch today which should fix this.
For your interest if you encounter any problem with my plugin you can add an issue at https://github.com/lou/multi-select/issues
Thanks
来源:https://stackoverflow.com/questions/16725015/multiselect-js-refresh-after-change