Pman.Tab.XtupleMetric.bjs
authorEdward <edward@roojs.com>
Tue, 5 Aug 2014 05:11:37 +0000 (13:11 +0800)
committerEdward <edward@roojs.com>
Tue, 5 Aug 2014 05:11:37 +0000 (13:11 +0800)
Pman.Tab.XtupleMetric.js

Pman.Tab.XtupleMetric.bjs
Pman.Tab.XtupleMetric.js

index 180b826..c978d06 100644 (file)
@@ -7,8 +7,7 @@
     "items": [
         {
             "listeners": {
-                "|activate": "function() {\n    _this.panel = this;\n    \n    \n    var pid = _this.form.findField('pohead_id').getValue() * 1;\n    if (pid < 1) {\n        Roo.MessageBox.alert(\"Save First\", \"Please save the purchase order first, before adding items\");\n        _this.dialog.layout.getRegion('center').showPanel(0);\n        return;\n    }\n    \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}",
-                "deactivate": "function (_self)\n{\n     if(_this.grid){\n        var ar = [];\n\n        _this.grid.ds.each(function(r) {\n            ar.push({\n                poitem_id : r.data.poitem_id,\n                poitem_itemsite_id : r.data.poitem_itemsite_id,\n                poitem_unitprice : r.data.poitem_unitprice,\n                poitem_qty_ordered : r.data.poitem_qty_ordered\n            });\n                \n        });\n        \n        _this.form.findField('items').setValue(JSON.stringify(ar));\n    }\n    _this.dontClose = true;\n    _this.form.doAction(\"submit\");\n\n}"
+                "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
             },
             "background": true,
             "fitContainer": true,
index cbbdaa4..66ff963 100644 (file)
@@ -20,39 +20,9 @@ Pman.Tab.XtupleMetric = new Roo.XComponent({
             listeners : {
                 activate : function() {
                     _this.panel = this;
-                    
-                    
-                    var pid = _this.form.findField('pohead_id').getValue() * 1;
-                    if (pid < 1) {
-                        Roo.MessageBox.alert("Save First", "Please save the purchase order first, before adding items");
-                        _this.dialog.layout.getRegion('center').showPanel(0);
-                        return;
-                    }
-                    
                     if (_this.grid) {
                         _this.grid.footer.onClick('first');
                     }
-                },
-                deactivate : function (_self)
-                {
-                     if(_this.grid){
-                        var ar = [];
-                
-                        _this.grid.ds.each(function(r) {
-                            ar.push({
-                                poitem_id : r.data.poitem_id,
-                                poitem_itemsite_id : r.data.poitem_itemsite_id,
-                                poitem_unitprice : r.data.poitem_unitprice,
-                                poitem_qty_ordered : r.data.poitem_qty_ordered
-                            });
-                                
-                        });
-                        
-                        _this.form.findField('items').setValue(JSON.stringify(ar));
-                    }
-                    _this.dontClose = true;
-                    _this.form.doAction("submit");
-                
                 }
             },
             background : true,