listeners : {
click : function (_self, e)
{
- // do some checks?
-
if(!_this.form.isValid()){
Roo.MessageBox.alert('Error', 'Please Correct all the errors in red');
return;
}
+ new Pman.Request({
+ url : baseURL + '/Roo/Core_company.php',
+ method : 'POST',
+ params : {
+ id : _this.form.findField('id').getValue() * 1,
+ name : _this.form.findField('name').getValue(),
+ _check_name : 1
+ },
+ success : function(res) {
+ _this.dialog.el.mask("Saving");
+ _this.form.doAction("submit");
+ },
+ failure : function(res) {
+ Roo.MessageBox.confirm(
+ "Confirm",
+ "The company name has been used. Save it anyway?",
+ function(res) {
+ if(res != 'yes') {
+ return;
+ }
+
+ _this.dialog.el.mask("Saving");
+ _this.form.doAction("submit");
+ }
+ );
+ }
+ });
+ return;
- _this.dialog.el.mask("Saving");
- _this.form.doAction("submit");
-
}
},
xns : Roo,
xtype : 'Form',
fileUpload : true,
labelWidth : 160,
- url : baseURL + '/Roo/Companies.php',
+ url : baseURL + '/Roo/core_company.php',
listeners : {
actioncomplete : function(f, act) {
_this.dialog.el.unmask();
Pman.Dialog.Image.show({
onid :_this.data.id,
- ontable : 'Companies',
+ ontable : 'core_company',
imgtype : 'LOGO'
}, function(data) {
if (data) {