简体   繁体   English

ASP.NET MVC 两个 select2 项目 - 只有一个样式

[英]ASP.NET MVC Two select2 items - only one is styled

I have two select tags, they are different only where id is and Item 2 has multiselect (i don't know why because they are the same objects and first one is also multiselect), but only one is styled, what I'm doing wrong or what I have forgotten about?我有两个 select 标签,它们仅在 id 所在的位置不同,并且项目 2 具有多选(我不知道为什么,因为它们是相同的对象,第一个也是多选),但只有一个是样式化的,我在做什么错了还是我忘记了什么?

This is how I see it:这就是我的看法:

两个选择项目,第一个是工作

Item 1项目 1

     @Html.ListBoxFor(m => m.SelectedFunkcjaTechnicznaWBudownictwie, 
    Model.FunkcjaTechnicznaWBudownictwieLst, 
    new { id = "FunkcjaList", @class = "dropdown-1 select2 show-tick form-control-plaintext", 
    @data_live_search = "true" })

         <select class="dropdown-symbox select2 show-tick form-control-plaintext select2-hidden-accessible"
 data-live-search="true" id="FunkcjaList" multiple="" name="SelectedFunkcjaTechnicznaWBudownictwie"
 data-select2-id="FunkcjaList" tabindex="-1" aria-hidden="true">
            <option value="1" data-select2-id="6494">Kierownik budowy</option>
            <option value="2" data-select2-id="6495">projektant</option>
    ...more options...
            </select>

Item 2第 2 项

         @Html.ListBoxFor(m => m.SelectedFunkcjaTechnicznaWBudownictwie, 
    Model.FunkcjaTechnicznaWBudownictwieLst, 
    new { id = "FunkcjaList2", @class = "dropdown-1 select2 show-tick form-control-plaintext",
     @data_live_search = "true" })


         <select class="dropdown-symbox select2 show-tick form-control-plaintext" 
data-live-search="true" id="FunkcjaList2" multiple="multiple" 
name="SelectedFunkcjaTechnicznaWBudownictwie">
            <option value="1">Kierownik budowy</option>
            <option value="2">projektant</option>
    ...more options...
            </select>

I suppose that you didn't write same code for both listboxes You forgot multiple property Look at the screenshot我想您没有为两个列表框编写相同的代码您忘记了多个属性查看屏幕截图

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM