Created
November 18, 2011 08:24
-
-
Save marvin/1375897 to your computer and use it in GitHub Desktop.
edit dialog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// new account form | |
$(function() { | |
$('.account-edit-dialog-form').dialog({ autoOpen: false }) | |
$( ".account-edit-dialog-form" ).dialog({ | |
autoOpen: false, | |
height: 300, | |
width: 500, | |
modal: true, | |
draggable: false, | |
resizable: false, | |
buttons: { | |
"Update Account": function() { | |
$.post(".", { | |
name: $form.find('#id_name').val(), | |
description: $form.find('#id_description').val(), | |
organizationtype: $form.find('#id_organizationtype').val(), | |
branchetype: $form.find('#id_branchetype').val(), | |
lead: $form.find('#id_lead').val(), | |
leadsource: $form.find('#id_leadsource').val(), | |
assigned: $form.find('#id_assigned').val(), | |
account_id:$("#account_id").val() | |
}, | |
function(data){ | |
if(data.status =="success"){ | |
$('.account-edit-dialog-form').dialog('destroy').remove(); | |
$.showMessage(data.data); | |
setTimeout("$.pjax({url: '',container: '#middle'})",100); | |
} else { | |
if (data.status == "error") { | |
$('.account-edit-dialog-form').append(data.data); | |
} | |
} | |
}, "json"); | |
}, | |
Abbrechen: function() { | |
$('.account-edit-dialog-form').dialog( "close" ); | |
} | |
}, | |
close: function() { | |
$('form :input').val(""); | |
} | |
}); | |
$('#account-edit').on("click", function() { | |
$( ".account-edit-dialog-form" ).dialog( "open" ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment