Pman.Dialog.CoreCompanies.bjs
[Pman.Core] / Pman.Dialog.CoreCompanies.js
index dbf78a6..aea8598 100644 (file)
@@ -61,10 +61,12 @@ Pman.Dialog.CoreCompanies = {
                                     _this.dialog.el.unmask();
                                     //console.log('load completed'); 
                                     // error messages?????
-                                    
+                                    if(act.type == 'setdata'){
+                                        this.load({ method: 'GET', params: { '_id' : _this.data.id }});
+                                        return;
+                                    }
                                    
                                     if (act.type == 'load') {
-                                        
                                         _this.data = act.result.data;
                                         var meth = _this.data.isOwner || !Pman.Login.isOwner() ? 'disable' : 'enable';
                                      
@@ -95,6 +97,7 @@ Pman.Dialog.CoreCompanies = {
                             },
                             fileUpload : true,
                             labelWidth : 160,
+                            url : baseURL + '/Roo/Person.php',
                             items : [
                                 {
                                     xtype: 'Column',
@@ -209,6 +212,7 @@ Pman.Dialog.CoreCompanies = {
                                             fieldLabel : 'Logo Image',
                                             height : 170,
                                             icon : 'rootURL + \'images/default/dd/drop-add.gif\'',
+                                            name : 'logo_id',
                                             style : 'border: 1px solid #ccc;',
                                             width : 170,
                                             valueRenderer : function(v) {
@@ -227,7 +231,7 @@ Pman.Dialog.CoreCompanies = {
                                             listeners : {
                                                 click : function (_self, e)
                                                 {
-                                                    var _t = this;
+                                                    var _t = _this.form.findField('logo_id');
                                                                          
                                                     Pman.Dialog.Image.show({
                                                         onid :_this.data.id,
@@ -273,11 +277,28 @@ Pman.Dialog.CoreCompanies = {
                 {
                     xtype: 'Button',
                     xns: Roo,
+                    listeners : {
+                        click : function (_self, e)
+                        {
+                            _this.dialog.hide();
+                        }
+                    },
                     text : "Cancel"
                 },
                 {
                     xtype: 'Button',
                     xns: Roo,
+                    listeners : {
+                        click : function (_self, e)
+                        {
+                            // do some checks?
+                             
+                            
+                            _this.dialog.el.mask("Saving");
+                            _this.form.doAction("submit");
+                        
+                        }
+                    },
                     text : "Save"
                 }
             ]