Pman.Tab.XtupleMetric.bjs
[Pman.Xtuple] / Pman.Tab.XtupleMetric.bjs
1 {
2     "id": "roo-file-374",
3     "name": "Pman.Tab.XtupleMetric",
4     "parent": "Pman.Tab.Admin",
5     "title": "",
6     "path": "/home/edward/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleMetric.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "center",
16             "tableName": "metric",
17             "title": "Metric",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|render": "function() \n{\n    _this.grid = this; \n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
24                         "afteredit": "function (e)\n{\n    if(e.originalValue == e.value || !e.value.length){\n        return false;\n    }\n    \n    e.record.commit();\n}"
25                     },
26                     "*prop": "grid",
27                     "autoExpandColumn": "metric_value",
28                     "clicksToEdit": 1,
29                     "loadMask": true,
30                     "xtype": "EditorGrid",
31                     "|xns": "Roo.grid",
32                     "items": [
33                         {
34                             "listeners": {
35                                 "beforeload": "function (_self, o){\n    o.params = o.params || {};\n    \n    var s = _this.searchBox.getValue();\n    \n    if(!s || !s.length){\n        return;\n    }\n    \n    o.params['search[name]'] = s;\n}\n",
36                                 "update": "function (_self, record, operation)\n{\n    if (operation != Roo.data.Record.COMMIT) {\n        return;\n    }\n\n    if (!record.data.metric_name.length || !record.data.metric_value.length) {\n        return;\n    }\n    \n    new Pman.Request({\n        url : baseURL + '/Roo/Metric',\n        method : 'POST',\n        params : record.data,\n        success : function(res) {\n            _this.grid.footer.onClick('refresh');\n        }\n    });\n    \n}"
37                             },
38                             "*prop": "dataSource",
39                             "remoteSort": true,
40                             "xtype": "Store",
41                             "|sortInfo": "{ field : 'metric_name', direction: 'ASC' }",
42                             "|xns": "Roo.data",
43                             "items": [
44                                 {
45                                     "*prop": "proxy",
46                                     "method": "GET",
47                                     "timeout": 90000,
48                                     "xtype": "HttpProxy",
49                                     "|url": "baseURL + '/Xtuple/Roo/Metric.php'",
50                                     "|xns": "Roo.data"
51                                 },
52                                 {
53                                     "*prop": "reader",
54                                     "id": "metric_id",
55                                     "root": "data",
56                                     "totalProperty": "total",
57                                     "xtype": "JsonReader",
58                                     "|fields": "[\n    {\n        'name': 'metric_id',\n        'type': 'int'\n    },\n    {\n        'name': 'metric_name',\n        'type': 'string'\n    },\n    {\n        'name': 'metric_value',\n        'type': 'string'\n    },\n    {\n        'name': 'metric_module',\n        'type': 'string'\n    }\n]",
59                                     "|xns": "Roo.data"
60                                 }
61                             ]
62                         },
63                         {
64                             "|xns": "Roo",
65                             "xtype": "Toolbar",
66                             "*prop": "toolbar",
67                             "items": [
68                                 {
69                                     "listeners": {
70                                         "specialkey": "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
71                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}"
72                                     },
73                                     "xtype": "TextField",
74                                     "|xns": "Roo.form"
75                                 },
76                                 {
77                                     "listeners": {
78                                         "click": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
79                                     },
80                                     "cls": "x-btn-icon",
81                                     "xtype": "Button",
82                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
83                                     "|xns": "Roo.Toolbar"
84                                 },
85                                 {
86                                     "listeners": {
87                                         "click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\r\n}"
88                                     },
89                                     "cls": "x-btn-icon",
90                                     "xtype": "Button",
91                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
92                                     "|xns": "Roo.Toolbar"
93                                 },
94                                 {
95                                     "|xns": "Roo.Toolbar",
96                                     "xtype": "Fill"
97                                 },
98                                 {
99                                     "listeners": {
100                                         "|click": "function()\n{\n\n   Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
101                                     },
102                                     "cls": "x-btn-text-icon",
103                                     "text": "Add",
104                                     "xtype": "Button",
105                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
106                                     "|xns": "Roo.Toolbar"
107                                 }
108                             ]
109                         },
110                         {
111                             "*prop": "footer",
112                             "displayInfo": true,
113                             "emptyMsg": "No Metric found",
114                             "pageSize": 50,
115                             "xtype": "PagingToolbar",
116                             "|xns": "Roo"
117                         },
118                         {
119                             "*prop": "colModel[]",
120                             "dataIndex": "metric_id",
121                             "header": "ID",
122                             "width": 75,
123                             "xtype": "ColumnModel",
124                             "|renderer": "function(v) { return String.format('{0}', v); }",
125                             "|xns": "Roo.grid"
126                         },
127                         {
128                             "*prop": "colModel[]",
129                             "dataIndex": "metric_name",
130                             "header": "Name",
131                             "width": 150,
132                             "xtype": "ColumnModel",
133                             "|renderer": "function(v) { return String.format('{0}', v); }",
134                             "|xns": "Roo.grid",
135                             "items": [
136                                 {
137                                     "|xns": "Roo.grid",
138                                     "xtype": "GridEditor",
139                                     "*prop": "editor",
140                                     "items": [
141                                         {
142                                             "*prop": "field",
143                                             "allowBlank": false,
144                                             "xtype": "TextField",
145                                             "|xns": "Roo.form"
146                                         }
147                                     ]
148                                 }
149                             ]
150                         },
151                         {
152                             "*prop": "colModel[]",
153                             "dataIndex": "metric_value",
154                             "header": "Value",
155                             "width": 150,
156                             "xtype": "ColumnModel",
157                             "|renderer": "function(v) { return String.format('{0}', v); }",
158                             "|xns": "Roo.grid",
159                             "items": [
160                                 {
161                                     "|xns": "Roo.grid",
162                                     "xtype": "GridEditor",
163                                     "*prop": "editor",
164                                     "items": [
165                                         {
166                                             "*prop": "field",
167                                             "allowBlank": false,
168                                             "xtype": "TextField",
169                                             "|xns": "Roo.form"
170                                         }
171                                     ]
172                                 }
173                             ]
174                         },
175                         {
176                             "*prop": "colModel[]",
177                             "dataIndex": "metric_module",
178                             "header": "Module",
179                             "width": 100,
180                             "xtype": "ColumnModel",
181                             "|renderer": "function(v) { return String.format('{0}', v); }",
182                             "|xns": "Roo.grid",
183                             "items": [
184                                 {
185                                     "|xns": "Roo.grid",
186                                     "xtype": "GridEditor",
187                                     "*prop": "editor",
188                                     "items": [
189                                         {
190                                             "*prop": "field",
191                                             "allowBlank": false,
192                                             "xtype": "TextField",
193                                             "|xns": "Roo.form"
194                                         }
195                                     ]
196                                 }
197                             ]
198                         }
199                     ]
200                 }
201             ]
202         }
203     ],
204     "permname": "",
205     "modOrder": "900"
206 }