このRun likeはまったく問題ありません。
// Save, set state to finalized and Print
$('#btnDialogPrint').click(function () {
if ($('#chkFinal').is(':checked')) {
$(function () {
$("#PrintDialog").dialog('close');
});
}
else {
$('#chkFinal').attr('checked', true); // Set finalized. This checkbox is not visible its like a hidden field
$('#btnSubmit').click(); // Save
}
});
そして、これもうまくいきます:
window.location = '../Print/' + $('#SalesContractId').val();
しかし、私がそれらをまとめると、実行されるのは
window.location = '../Print/' + $('#SalesContractId').val();
完全なコード:
// Save, set state to finalized and Print
$('#btnDialogPrint').click(function () {
if ($('#chkFinal').is(':checked')) {
$(function () {
$("#PrintDialog").dialog('close');
window.location = '../Print/' + $('#SalesContractId').val(); // Moves to ContractController Print
});
}
else {
$('#chkFinal').attr('checked', true); // Set finalized. This checkbox is not visible its like a hidden field
$('#btnSubmit').click(); // Save
window.location = '../Print/' + $('#SalesContractId').val(); // does not alow above code to execute
}
});