From 1fb7a7be481621e5e78ef41784ce86492f5b18fd Mon Sep 17 00:00:00 2001 From: Edward Date: Tue, 5 Aug 2014 15:00:22 +0800 Subject: [PATCH] Pman.Tab.XtupleMetric.bjs Pman.Tab.XtupleMetric.js --- Pman.Tab.XtupleMetric.bjs | 2 +- Pman.Tab.XtupleMetric.js | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Pman.Tab.XtupleMetric.bjs b/Pman.Tab.XtupleMetric.bjs index 096b1c87..63f1a0da 100644 --- a/Pman.Tab.XtupleMetric.bjs +++ b/Pman.Tab.XtupleMetric.bjs @@ -97,7 +97,7 @@ }, { "listeners": { - "|click": "function()\n{\n\n Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() {\n _this.grid.footer.onClick('first');\n }); \n}\n" + "|click": "function()\n{\n \n var nr = _this.grid.ds.reader.newRow({\n metric_id : 0,\n metric_name : '',\n metric_value : '',\n metric_module : ''\n });\n \n _this.grid.stopEditing();\n _this.grid.ds.insert(0, nr); \n _this.grid.startEditing(0, 0);\n}\n" }, "cls": "x-btn-text-icon", "text": "Add", diff --git a/Pman.Tab.XtupleMetric.js b/Pman.Tab.XtupleMetric.js index c2db6c6a..40cde54d 100644 --- a/Pman.Tab.XtupleMetric.js +++ b/Pman.Tab.XtupleMetric.js @@ -178,10 +178,17 @@ Pman.Tab.XtupleMetric = new Roo.XComponent({ listeners : { click : function() { - - Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() { - _this.grid.footer.onClick('first'); - }); + + var nr = _this.grid.ds.reader.newRow({ + metric_id : 0, + metric_name : '', + metric_value : '', + metric_module : '' + }); + + _this.grid.stopEditing(); + _this.grid.ds.insert(0, nr); + _this.grid.startEditing(0, 0); } }, cls : 'x-btn-text-icon', -- 2.39.2