点击该按钮时引导 - 选择ASPNET中没有显示的选项 [英] Bootstrap-Select in ASPNET not showing the options when clicking the button
问题描述
我使用asp.net和引导。我已经得到了我想要使用引导选以deuglify一个DropDownList。问题是,如果我点击DropDownList的,它并不显示其内容,但如果我preSS时,它的重点将显示DropDownList的内容的关键。
I'm using asp.net and bootstrap. I've got a dropdownlist that I want to deuglify using bootstrap-select. The problem is that if I click the dropdownlist, it doesn't show its content, but if I press a key when it's focused it will display the contents of the dropdownlist.
负责人:
<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="/Scripts/bootstrap-select.min.js" />
<script type="text/javascript" src="/Scripts/bootstrap.js"></script>
<link rel="stylesheet" href="/css/bootstrap.css" />
<link rel="stylesheet" href="/css/bootstrap-select.min.css" />
<link rel="stylesheet" href="/css/bootstrap.min.css" />
JS:
<script type="text/javascript">
$(document).ready(function () {
$('select').selectpicker();
});
</script>
该JS位于身体后。
The JS is located after the body.
推荐答案
我这个问题纠结今晚,虽然我不喜欢用什么asp.net。我发现,在某些情况下,潜在的引导事件无法
I wrestled with this problem tonight, although I don't use anything like asp.net. I discovered that in some circumstances the underlying bootstrap events were not firing.
引导选择使用一个按钮来切换菜单项列表,并使用授权事件绑定到切换按钮。有时,当自举选产生的切换按钮代表团不能正常工作。
Bootstrap selects use a button to toggle the list of menu items, and use delegation to bind events to to the toggle button. Sometimes when bootstrap-select generates the toggle button the delegation does not work properly.
我发现,通过使用切换按钮中的JavaScript界面后引导 - 选择创造了它,一切都很好:
I found that by using the JavaScript interface on the toggle button after bootstrap-select created it, all was well:
$('select').selectpicker();
$('.dropdown-toggle').dropdown();
这篇关于点击该按钮时引导 - 选择ASPNET中没有显示的选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!