Bootstrap设置默认选中 [英] Bootstrap set default selected

查看:140
本文介绍了Bootstrap设置默认选中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我使用bootstrap多个下拉列表我的项目

所以我有数据源。当页面出现时我应该选择一些意见吗?





这是我输出的html

 <   div     class   =  multiselectdrop >  


< 选择 名称 = ctl00 $ cPlaceHolder $ ddlGearType id = cPlaceHolder_ddlGearType class = selectpicker title = xxx multiple = style = display:none; >
< 选项 value = DüzVites > xxx < / option >
< 选项 = Otomatik > zzzzz < / option > ;

< / select > < div class = btn-group bootstrap-select show-tick open > < 按钮 type = 按钮 class = btn dropdown-toggle selectpicker btn-default data-toggle = < span class =code-keyword>下拉列表 data-id = cPlaceHolder_ddlGearType 标题 = xxx > ; < span class = filter-option pull-left > xxx < / span > < span class = 插入符号 > < / span > < / button > < ; div class < span class =code-keyword> = 下拉菜单打开 样式 = 最大高度:186px;溢出:隐藏; min-height:0px; > < ul class = dropdown-menu inner selectpicker role = menu style = max-height:174px; overflow-y:auto; min-height:0px; > < li rel = 0 class = > < a tabindex = 0 class = 样式 = > < span class = text > xxxx < / span > < / a > < / li > < li rel = 1 class = > < a tabindex = 0 class = style = > < span class = text > XXXX < / span > < / a > < / li > < / ul > < / div > < / div >

< / div >

解决方案

cPlaceHolder

ddlGearType id = cPlaceHolder_ddlGearType class = selectpicker title = xxx multiple = style = display:none; >
< 选项 value = DüzVites > xxx < / option < span class =code-keyword>>
< 选项 value = Otomatik > zzzzz < / option >

< / select > < div class = btn-group bootstrap-select show-tick open > < 按钮 类型 = 按钮 class = btn dropdown-toggle selectpicker btn-default data-toggle = 下拉列表 data-id = cPlaceHolder_ddlGearType title = xxx > < span class = filter-option pull-left > xxx < / span > < span class = caret > < / span > < / button > < div < span class =code-attribute> class = 下拉菜单打开 样式 = max-height:186px;溢出:隐藏; min-height:0px; > < ul class = dropdown-menu inner selectpicker role = menu style = max-height:174px; overflow-y:auto; min-height:0px; > < li rel = 0 class = > < a tabindex = 0 class = 样式 = > < span class = text > xxxx < / span > < / a > < / li > < li rel = 1 class = > < a tabindex = 0 class = style = > < span class = text > XXXX < / span > < / a > < / li > < / ul > < / div > < / div >

< / div >


您好,



请看看工作演示:



Bootstrap - Multiselect [ ^ ]


Hi guys I use bootstrap multiple dropdown my projects
so I have datasource. and some opinon should selected when page came how can I do?


this is my output of html

<div class="multiselectdrop">


                    <select name="ctl00$cPlaceHolder$ddlGearType" id="cPlaceHolder_ddlGearType" class="selectpicker" title="xxx" multiple="" style="display: none;">
	<option value="Düz Vites">xxx</option>
	<option value="Otomatik">zzzzz</option>

</select><div class="btn-group bootstrap-select show-tick open"><button type="button" class="btn dropdown-toggle selectpicker btn-default" data-toggle="dropdown" data-id="cPlaceHolder_ddlGearType" title="xxx"><span class="filter-option pull-left">xxx</span> <span class="caret"></span></button><div class="dropdown-menu open" style="max-height: 186px; overflow: hidden; min-height: 0px;"><ul class="dropdown-menu inner selectpicker" role="menu" style="max-height: 174px; overflow-y: auto; min-height: 0px;"><li rel="0" class=""><a tabindex="0" class="" style=""><span class="text">xxxx</span></a></li><li rel="1" class=""><a tabindex="0" class="" style=""><span class="text">xxxx</span></a></li></ul></div></div>

                </div>

解决方案

cPlaceHolder


ddlGearType" id="cPlaceHolder_ddlGearType" class="selectpicker" title="xxx" multiple="" style="display: none;"> <option value="Düz Vites">xxx</option> <option value="Otomatik">zzzzz</option> </select><div class="btn-group bootstrap-select show-tick open"><button type="button" class="btn dropdown-toggle selectpicker btn-default" data-toggle="dropdown" data-id="cPlaceHolder_ddlGearType" title="xxx"><span class="filter-option pull-left">xxx</span> <span class="caret"></span></button><div class="dropdown-menu open" style="max-height: 186px; overflow: hidden; min-height: 0px;"><ul class="dropdown-menu inner selectpicker" role="menu" style="max-height: 174px; overflow-y: auto; min-height: 0px;"><li rel="0" class=""><a tabindex="0" class="" style=""><span class="text">xxxx</span></a></li><li rel="1" class=""><a tabindex="0" class="" style=""><span class="text">xxxx</span></a></li></ul></div></div> </div>


Hello,

Please see the working demo:

Bootstrap - Multiselect[^]


这篇关于Bootstrap设置默认选中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆