「親」jQueryダイアログは、OKボタンが押されたときに1つから多くのjQueryダイアログにまたがることがあります。また、子ダイアログを作成しないこともあります。 また、親のOKボタンが押されたときに確認ページに移動したいと思っています。0から多くの子jqueryダイアログを含むjqueryダイアログ
子供のスタックオプションを使用して、「スタック」ダイアログボックスを機能させました。私の問題は、「親」で「OK」ボタンを押したときにコードが実行され続け、ユーザーが「子」ダイアログに応答する前にブラウザが確認ページに移動したときです。
コードが引き続き親のOKイベントから確認ページに移動する前に、子ダイアログが応答されるまで、親が待つ方法はありますか?
私の唯一の他の考え方は、実際には "子" OKボタンを押して確認ページに移動させるということでした。コードを少し複雑にする可能性がありました。子供に最後の子であることを知らせるコードが必要ですユーザーを確認ページに移動させることができます。
function getDeclineReason(appName) {
$("#dvDeclineReason")
.dialog({
modal: true,
stack: true,
title: 'Decline Reason',
open: function() {
$('.ui-widget-content').css('background', 'white');
$('.ui-widget-header').css('background', '#0072C6');
$('.ui-widget-header').css('border', '1px solid #0072C6');
},
buttons: {
OK: function() {
$(this).dialog("close");
return;
},
Cancel: function() {
$(this).dialog("close");
return;
}
},
zIndex: 10000,
autoOpen: true,
width: 'auto',
resizable: false,
draggable: false,
});
}
function reviewRequest() {
getDeclineReason("Test");
$("#dvReview")
.dialog({
modal: true,
title: 'Review Request',
open: function() {
$('.ui-widget-content').css('background', 'white');
$('.ui-widget-header').css('background', '#0072C6');
$('.ui-widget-header').css('border', '1px solid #0072C6');
},
buttons: {
OK: function() {
var numChecked = 0;
$('input[name="apps"]').each(function() {
if (NWF$(this).is(':checked'))
numChecked++;
});
if (numChecked == 0) {
if (!confirm("You have not approved any applications. If this was you intent then press OK to confirm the deny of all applications. Otherwise press cancel to try again."))
return;
}
var totalApps = $('input[name="apps"]').length;
var countApps = 0;
$('input[name="apps"]').each(function() {
var decision;
if (NWF$(this).is(':checked'))
decision = "Approved";
else {
decision = "Declined";
getDeclineReason($(this).text());
}
switch (status) {
case "Pend Mgr Review":
updateFields["Title"] = "Manager Decision";
break;
case "Pend App Owner Review":
updateFields["Title"] = "App Owner Decision";
break;
}
countApps++;
/*
\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t updateFields["RequestNumber"] = requestNum; \t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t updateFields["Application"] = $(this).text(); // Get value from current check box item
\t \t \t \t \t \t \t \t \t updateFields["AppStatusID"] = $(this).val();
\t \t \t \t \t \t \t \t \t updateFields["Decision"] = decision;
\t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t if (countApps == totalApps)
\t \t \t \t \t \t \t \t \t \t updateFields["LastDecision"] = "Y";
\t \t \t \t \t \t \t \t \t else
\t \t \t \t \t \t \t \t \t \t updateFields["LastDecision"] = "N"; \t
\t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t addListItem("Decision",updateFields); \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t
\t \t \t \t \t \t \t \t \t */
});
$(this).dialog("close");
//window.location.href = "/apps/TAI/SitePages/Decisioned.aspx";
return;
},
Cancel: function() {
$(this).dialog("close");
return;
}
},
zIndex: 10000,
autoOpen: true,
width: 'auto',
resizable: false,
draggable: false,
});
}
コードスニペットを実行しても何も起こりません。そして、「ちょっとした」というオプションを親切に使ってください! –