$('#create-project-alias-submit').live('click', function () {
var form = $(this).closest('form');
var projectid = $('input[name="CreateProjectAlias.ProjectID"]').val();
$(form).validate().settings.submitHandler = function (form) {
$.ajax({
type: "POST",
url: form.action,
data: {
AliasName: $('input[name="CreateProjectAlias.AliasName"]').val(),
ProjectID: projectid
},
traditional: true,
success: function (result) {
if (result.success) {
// update site alias grid
$('span#ProjectAliasesCount' + projectid).html(result.totalCount);
var grid1 = $("#ProjectAliases_" + projectid).data("tGrid");
grid1.rebind({ projectId: projectid });
$('#AddProjectAliasWindow').data('tWindow').close();
}
RemoveInterruptMessage();
},
error: function (req, status, error) {
RemoveInterruptMessage();
alert("The server encountered an error");
}
});
};
$(form).submit();
});
var form = $(this).closest('form');
var projectid = $('input[name="CreateProjectAlias.ProjectID"]').val();
$(form).validate().settings.submitHandler = function (form) {
$.ajax({
type: "POST",
url: form.action,
data: {
AliasName: $('input[name="CreateProjectAlias.AliasName"]').val(),
ProjectID: projectid
},
traditional: true,
success: function (result) {
if (result.success) {
// update site alias grid
$('span#ProjectAliasesCount' + projectid).html(result.totalCount);
var grid1 = $("#ProjectAliases_" + projectid).data("tGrid");
grid1.rebind({ projectId: projectid });
$('#AddProjectAliasWindow').data('tWindow').close();
}
RemoveInterruptMessage();
},
error: function (req, status, error) {
RemoveInterruptMessage();
alert("The server encountered an error");
}
});
};
$(form).submit();
});
No comments:
Post a Comment