bootstrap bootstrap 模式中的日期选择器
bootstrap datepicker in bootstrap modal
我在 #editorWin
div 中有一个模式 window,可以从页面上的多个位置打开它。每次它都有不同的内容,来自 Ajax 以下列方式查询:
$('#editorWin').on('show.bs.modal', function (event) {
$('#modalCont').html('Loading...')
$.ajax({
// load AJAX content and overwrite Load... message
})
});
当模式 window 打开时,我想在其中使用 Bootstrap 日期选择器小部件。但是,当我单击日期选择器时,我的模式 window 的 AJAX 加载内容消失了。
我怀疑打开日期选择器可能会触发 show.bs.modal
事件,这会扰乱我以前的功能,但我不确定。
控制台没有JS错误
我在类似的问题中找到了答案:
要解决此问题,必须将 show.bs.modal
替换为 shown.bs.modal
。
我在 #editorWin
div 中有一个模式 window,可以从页面上的多个位置打开它。每次它都有不同的内容,来自 Ajax 以下列方式查询:
$('#editorWin').on('show.bs.modal', function (event) {
$('#modalCont').html('Loading...')
$.ajax({
// load AJAX content and overwrite Load... message
})
});
当模式 window 打开时,我想在其中使用 Bootstrap 日期选择器小部件。但是,当我单击日期选择器时,我的模式 window 的 AJAX 加载内容消失了。
我怀疑打开日期选择器可能会触发 show.bs.modal
事件,这会扰乱我以前的功能,但我不确定。
控制台没有JS错误
我在类似的问题中找到了答案:
要解决此问题,必须将 show.bs.modal
替换为 shown.bs.modal
。