admin 管理员组文章数量: 1086019
I've been testing bootstrap-duallistbox and its fantastic, but I was wondering how to disable the bootstrap-dual listbox at the beginning:
so I have:
<select multiple="multiple" size="10" class="dual-list" disabled>
<option value="1">1</option>
<option value="2">2</option>
</select>
after call: $(".dual-list").bootstrapDualListbox();
the dual list is not disabled.
I've been testing bootstrap-duallistbox and its fantastic, but I was wondering how to disable the bootstrap-dual listbox at the beginning:
so I have:
<select multiple="multiple" size="10" class="dual-list" disabled>
<option value="1">1</option>
<option value="2">2</option>
</select>
after call: $(".dual-list").bootstrapDualListbox();
the dual list is not disabled.
1 Answer
Reset to default 8Look in the ments section of the link you posted:
There is no built-in support for disable, so you need to disable the proper elements by selecting them by hand, something like that:
$('select[name="duallistbox_demo1[]_helper1"]').prop('disabled', true); $('select[name="duallistbox_demo1[]_helper2"]').prop('disabled', true); $('select[name="duallistbox_demo1[]"]').parent().find('.moveall').prop('disabled',true); $('select[name="duallistbox_demo1[]"]').parent().find('.move').prop('disabled',true); $('select[name="duallistbox_demo1[]"]').parent().find('.removeall').prop('disabled',true); $('select[name="duallistbox_demo1[]"]').parent().find('.remove').prop('disabled',true);
:) .. Well, I was managing this via this one line instead of 6 or 7. A property would have been cleaner. Thanks though
$(".bootstrap-duallistbox-container").find("*").prop("disabled",true);
via István Ujj-Mészáros and WorkerBee
本文标签: javascriptDisabled bootstrapduallistboxStack Overflow
版权声明:本文标题:javascript - Disabled bootstrap-duallistbox - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/p/1744083484a2530687.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论