这个运行就像它非常好。
// 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
}
});