multiselect.js refresh after change

天大地大妈咪最大 提交于 2020-01-05 07:48:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!