【发布时间】:2015-04-20 17:55:34
【问题描述】:
我在我的下拉列表中实现了 select2,它位于引导模式窗口内。
<div class="modal-body">
...
<div class="controls">
@Html.DropDownList("Experts", new SelectList(Model.ExpertsInfo, "UserId", "FullName"),
string.Empty, new { @class = "select", id = "expert-select", autocomplete = "true", autofocus = "", style = "width: 295px;" }
</div>
...
</div>
$("#experts").select2({
allowClear: true,
minimumResultsForSearch: -1,
formatNoMatches: function () {
return "@CommonResources.NoMatches";
}
});
一切正常,但如果我关闭模态窗口,当下拉菜单打开时,模态窗口隐藏但下拉菜单仍然存在!我在哪里出错了?我是否必须为 esc 键实现自己的处理程序?
【问题讨论】:
-
用你的代码创建一个小提琴......可能更自我解释......
标签: javascript asp.net asp.net-mvc twitter-bootstrap jquery-select2