Pman.Tab.XtupleMetric.bjs
authorEdward <edward@roojs.com>
Tue, 5 Aug 2014 06:49:29 +0000 (14:49 +0800)
committerEdward <edward@roojs.com>
Tue, 5 Aug 2014 06:49:29 +0000 (14:49 +0800)
Pman.Tab.XtupleMetric.js

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

index c4e4221..0d023d3 100644 (file)
@@ -21,7 +21,7 @@
                 {
                     "listeners": {
                         "|render": "function() \n{\n    _this.grid = this; \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
-                        "beforeedit": "function (e)\n{\n    Roo.log(e);\n}"
+                        "afteredit": "function (e)\n{\n    if(e.originalValue == e.value || !e.value.length){\n        return false;\n    }\n    \n    e.record.commit();\n}"
                     },
                     "*prop": "grid",
                     "autoExpandColumn": "metric_value",
                             "width": 150,
                             "xtype": "ColumnModel",
                             "|renderer": "function(v) { return String.format('{0}', v); }",
-                            "|xns": "Roo.grid"
+                            "|xns": "Roo.grid",
+                            "items": [
+                                {
+                                    "|xns": "Roo.grid",
+                                    "xtype": "GridEditor",
+                                    "*prop": "editor",
+                                    "items": [
+                                        {
+                                            "*prop": "field",
+                                            "allowBlank": false,
+                                            "xtype": "TextField",
+                                            "|xns": "Roo.form"
+                                        }
+                                    ]
+                                }
+                            ]
                         },
                         {
                             "*prop": "colModel[]",
                             "width": 100,
                             "xtype": "ColumnModel",
                             "|renderer": "function(v) { return String.format('{0}', v); }",
-                            "|xns": "Roo.grid"
+                            "|xns": "Roo.grid",
+                            "items": [
+                                {
+                                    "|xns": "Roo.grid",
+                                    "xtype": "GridEditor",
+                                    "*prop": "editor",
+                                    "items": [
+                                        {
+                                            "*prop": "field",
+                                            "allowBlank": false,
+                                            "xtype": "TextField",
+                                            "|xns": "Roo.form"
+                                        }
+                                    ]
+                                }
+                            ]
                         }
                     ]
                 }
index b7e683a..a577642 100644 (file)
@@ -42,9 +42,13 @@ Pman.Tab.XtupleMetric = new Roo.XComponent({
                            this.footer.onClick('first');
                         }
                     },
-                    beforeedit : function (e)
+                    afteredit : function (e)
                     {
-                        Roo.log(e);
+                        if(e.originalValue == e.value || !e.value.length){
+                            return false;
+                        }
+                        
+                        e.record.commit();
                     }
                 },
                 autoExpandColumn : 'metric_value',
@@ -205,7 +209,16 @@ Pman.Tab.XtupleMetric = new Roo.XComponent({
                         dataIndex : 'metric_value',
                         header : 'Value',
                         width : 150,
-                        renderer : function(v) { return String.format('{0}', v); }
+                        renderer : function(v) { return String.format('{0}', v); },
+                        editor : {
+                            xtype: 'GridEditor',
+                            xns: Roo.grid,
+                            field : {
+                                xtype: 'TextField',
+                                xns: Roo.form,
+                                allowBlank : false
+                            }
+                        }
                     },
                     {
                         xtype: 'ColumnModel',
@@ -213,7 +226,16 @@ Pman.Tab.XtupleMetric = new Roo.XComponent({
                         dataIndex : 'metric_module',
                         header : 'Module',
                         width : 100,
-                        renderer : function(v) { return String.format('{0}', v); }
+                        renderer : function(v) { return String.format('{0}', v); },
+                        editor : {
+                            xtype: 'GridEditor',
+                            xns: Roo.grid,
+                            field : {
+                                xtype: 'TextField',
+                                xns: Roo.form,
+                                allowBlank : false
+                            }
+                        }
                     }
                 ]
             }