1 つの jQuery ダイアログを作成しました。以下は、私が作成した Ajax 関数です。
$.ajax({
url: "/StaffManageCertifications/GetExamCodesAndCategory/",
type: "Post",
datatype: "html",
success: function (data) {
debugger;
$('#divExamCodesCategory').html(data);
$("#divExamCodesCategory").dialog({
autoOpen: false,
width: 700,
height: 610,
modal: true,
resizable: false,
draggable: true,
title: 'Add Exam Code/Category'
});
$("#divExamCodesCategory").dialog("open");
$('a.ui-dialog-titlebar-close').remove();
$('#divProcessImage').css({
"display": "none"
});
},
error: function (req, status, error) {
ErrorMessageStaff(req.responseText);
$('#screen').css({
"display": "block",
"width": "",
"height": ""
});
$('#divProcessImage').css({
"display": "none"
});
}
});
今、その div = divExamCodesCategory に 2 つのボタン (OK とキャンセル) を配置しました。
このダイアログを閉じるたびに破棄するコード行の下に記述されています。
$("#divExamCodesCategory").dialog("destroy");
今、2回目に開いたときに、最初のクリックでダイアログが表示されません。2 回目のクリック - ダイアログは表示されますが、データは表示されません。空のダイアログ。
また、画面中央に来ていません。画面の一番下まで落ちます。以下は、このダイアログの位置スタイルです。
.ui-dialog {
padding: 0em !important;
position: fixed !important;
}
これに関する任意のヘルプをいただければ幸いです。
ありがとう。