Jquery 部分视图模式下的引导daterangepicker未触发
我在应用程序中使用引导模式和部分视图为用户加载表单 我正在尝试在我的一个表单中使用daterangepicker,它实际上在Chrome上运行良好,但我就是无法在IE上运行。有人能告诉我出了什么问题吗?就好像IE完全忽略了我的回调函数 部分视图中的我的表单:Jquery 部分视图模式下的引导daterangepicker未触发,jquery,asp.net-mvc-3,razor,twitter-bootstrap-3,Jquery,Asp.net Mvc 3,Razor,Twitter Bootstrap 3,我在应用程序中使用引导模式和部分视图为用户加载表单 我正在尝试在我的一个表单中使用daterangepicker,它实际上在Chrome上运行良好,但我就是无法在IE上运行。有人能告诉我出了什么问题吗?就好像IE完全忽略了我的回调函数 部分视图中的我的表单: @using (Html.BeginForm("SaveKPI", "Channel")) { <fieldset> @Html.HiddenFor(mode
@using (Html.BeginForm("SaveKPI", "Channel"))
{
<fieldset>
@Html.HiddenFor(modelItem => Model.CampaignId)
<div id="kpireportrange" class="pull-right" class="datepicker">
<i class="fa fa-calendar fa-lg"></i><span></span>@Html.HiddenFor(modelItem => Model.SelectedStartDate, new
{
id = "startDate"
})
<b class="caret"></b></div>
@Html.DropDownListFor(modelItem => Model.AttributeId, new SelectList(Model.AllAttributes, "AttributeId", "Name"), new
{
@class = "form-control",
@style = "width:250px"
})
Target: @Html.TextBoxFor(modelItem => Model.AttributeValue, new
{
@class = "form-control",
@value = "Vul hier het aantal in..",
@style = "width:250px"
})
<br />
<button type="submit" class="btn btn-default" id="btnSave">
KPI TOEVOEGEN</button>
</fieldset>
}
$(document).ready(function ()
{
$('#kpireportrange span').html(moment().format('MMMM YYYY'));
var elem = document.getElementById("startDate");
elem.value = moment().format('MMMM YYYY');
$('#kpireportrange').daterangepicker(
{
ranges: {
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')]
},
startDate: moment(),
endDate: moment()
},
function (start, end)
{
$('#kpireportrange span').html(start.format('MMMM YYYY'));
var elem = document.getElementById("startDate");
elem.value = start.format('MMMM YYYY');
}
);
});
终于在这里找到了我的问题的解决方案: 加上这个就成功了
$.fn.modal.Constructor.prototype.enforceFocus = function () {};
哇
在show.bs.modal函数的上方添加了一行。。为我工作
$'aboutModal'。在'show.bs.modal'上,函数e{
$.fn.modal.Constructor.prototype.enforceFocus=函数{}请尝试解释您的答案与现有答案的不同之处。如果您也得出了与现有答案相同的答案,只需更新现有答案。我发现您在这方面没有足够的声誉。但再次添加相同的答案没有任何好处。