我的代码放在这样的局部视图中:
@Html.DropDownListFor(model => model.UserProfileInstance.Employee_Id, new SelectList(Model.EmployeeList, "Id", "FullName"), new { id = "e1" })
<script>
$(document).ready(function() {
$("#e1").select2();
}
</script>Run Code Online (Sandbox Code Playgroud)
第一次它正常工作,但在Ajax的部分视图表单刷新后,它再次正确加载但无法搜索,输入框被禁用.我在多个select2中没有这个问题.