この回避策は私のためにそれをしました。この問題に対するより良いアプローチは大歓迎です。
function BootboxContent() {
var frm_str = '<form id="some-form">'
+ '<div class="form-group">'
+ '<label for="date">Date</label>'
+ '<input id="date" class="date span2 form-control input-sm" size="16" placeholder="dd-mm-yy" type="text">'
+ '</div>'
+ '</form>';
var object = $('<div/>').html(frm_str).contents();
object.find('.date').datepicker({
format: 'yyyy-mm-dd',
autoclose: true
}).on('changeDate', function (ev) {
$(this).blur();
$(this).datepicker('hide');
});
return object
}
//Show the datepicker in the bootbox
bootbox.dialog({
message: BootboxContent,
title: "Reschedule Rule",
buttons: {
main: {
label: "OK",
className: "btn-primary"
}
}
});
日付ピッカーは、モーダル オーバーレイの背後に表示されます。datepicker.css で、z-index: 99999 !importantを.datepickerに追加します。
ブートボックス ダイアログ ボックスの位置に応じて日付ピッカー入力のすぐ下にあるカレンダーを調整するには、次のスタイルを追加します。
.modal-open .datepicker {
left: 52% !important; //Change it according to the position of your dialog
top: 25% !important; //Change it according to the position of your dialog
}