【问题标题】:How do I fit the select2 multiselect field for the whole page?如何适合整个页面的 select2 多选字段?
【发布时间】:2019-09-03 10:10:58
【问题描述】:

我正在尝试使用 thymeleaf 和 Select2 构建一个不错的多选。数据由 Thymeleaf 传输,并创建包含所有数据的多选。 Select2 只能有条件地工作。

在tag中使用style="width: 100%",问题没有解决。它可能附加到引导程序或其他东西。

[...] //Other Code
<div class="row">
 <div class="col-sm-12">
  <label for="sektor">Sektoren</label>
  <div class="input-group">
    <select id="sektoren" class="select2_multiple" multiple="multiple" name="sektoren[]"  th:field="*{sektoren}" size=4>
     <option th:each="sektoren : ${konfigForm.sektorenArray}" th:value="${sektoren}" th:utext="${sektoren}"></option>
    </select>
  [...] //Some Code for the Info-Modul Button (working fine)
  </div>
 </div>
</div>

问题,选择字段没有延伸到整个页面。这些值是垂直列出的,整个字段都是压缩的。

多选截图:https://www.imagebanana.com/s/1520/oTJHdnFw.html

【问题讨论】:

    标签: html bootstrap-4 thymeleaf jquery-select2


    【解决方案1】:

    试试这个:

    .content-article{
        max-width: 100% !important;
        margin: 0 !important;
    }
    

    【讨论】:

    • 感谢您的回答。我把 style="width: 100%" 放在了错误的 Select Tag 中。现在它工作正常。
    猜你喜欢
    • 1970-01-01
    • 2012-01-12
    • 2021-08-23
    • 2020-03-16
    • 1970-01-01
    • 1970-01-01
    • 2018-06-03
    • 1970-01-01
    • 2018-12-04
    相关资源
    最近更新 更多