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                         "beforeedit": "function (e)\n{\n    Roo.log(e);\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                             },
37                             "*prop": "dataSource",
38                             "remoteSort": true,
39                             "xtype": "Store",
40                             "|sortInfo": "{ field : 'metric_name', direction: 'ASC' }",
41                             "|xns": "Roo.data",
42                             "items": [
43                                 {
44                                     "*prop": "proxy",
45                                     "method": "GET",
46                                     "timeout": 90000,
47                                     "xtype": "HttpProxy",
48                                     "|url": "baseURL + '/Xtuple/Roo/Metric.php'",
49                                     "|xns": "Roo.data"
50                                 },
51                                 {
52                                     "*prop": "reader",
53                                     "id": "metric_id",
54                                     "root": "data",
55                                     "totalProperty": "total",
56                                     "xtype": "JsonReader",
57                                     "|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]",
58                                     "|xns": "Roo.data"
59                                 }
60                             ]
61                         },
62                         {
63                             "|xns": "Roo",
64                             "xtype": "Toolbar",
65                             "*prop": "toolbar",
66                             "items": [
67                                 {
68                                     "listeners": {
69                                         "specialkey": "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
70                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}"
71                                     },
72                                     "xtype": "TextField",
73                                     "|xns": "Roo.form"
74                                 },
75                                 {
76                                     "listeners": {
77                                         "click": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
78                                     },
79                                     "cls": "x-btn-icon",
80                                     "xtype": "Button",
81                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
82                                     "|xns": "Roo.Toolbar"
83                                 },
84                                 {
85                                     "listeners": {
86                                         "click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\r\n}"
87                                     },
88                                     "cls": "x-btn-icon",
89                                     "xtype": "Button",
90                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
91                                     "|xns": "Roo.Toolbar"
92                                 },
93                                 {
94                                     "|xns": "Roo.Toolbar",
95                                     "xtype": "Fill"
96                                 },
97                                 {
98                                     "listeners": {
99                                         "|click": "function()\n{\n\n   Pman.Dialog.XtupleSalesOrderNew.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
100                                     },
101                                     "cls": "x-btn-text-icon",
102                                     "text": "Add",
103                                     "xtype": "Button",
104                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
105                                     "|xns": "Roo.Toolbar"
106                                 }
107                             ]
108                         },
109                         {
110                             "*prop": "footer",
111                             "displayInfo": true,
112                             "emptyMsg": "No Metric found",
113                             "pageSize": 50,
114                             "xtype": "PagingToolbar",
115                             "|xns": "Roo"
116                         },
117                         {
118                             "*prop": "colModel[]",
119                             "dataIndex": "metric_id",
120                             "header": "ID",
121                             "width": 75,
122                             "xtype": "ColumnModel",
123                             "|renderer": "function(v) { return String.format('{0}', v); }",
124                             "|xns": "Roo.grid"
125                         },
126                         {
127                             "*prop": "colModel[]",
128                             "dataIndex": "metric_name",
129                             "header": "Name",
130                             "width": 150,
131                             "xtype": "ColumnModel",
132                             "|renderer": "function(v) { return String.format('{0}', v); }",
133                             "|xns": "Roo.grid",
134                             "items": [
135                                 {
136                                     "|xns": "Roo.grid",
137                                     "xtype": "GridEditor",
138                                     "*prop": "editor",
139                                     "items": [
140                                         {
141                                             "*prop": "field",
142                                             "allowBlank": false,
143                                             "xtype": "TextField",
144                                             "|xns": "Roo.form"
145                                         }
146                                     ]
147                                 }
148                             ]
149                         },
150                         {
151                             "*prop": "colModel[]",
152                             "dataIndex": "metric_value",
153                             "header": "Value",
154                             "width": 150,
155                             "xtype": "ColumnModel",
156                             "|renderer": "function(v) { return String.format('{0}', v); }",
157                             "|xns": "Roo.grid"
158                         },
159                         {
160                             "*prop": "colModel[]",
161                             "dataIndex": "metric_module",
162                             "header": "Module",
163                             "width": 100,
164                             "xtype": "ColumnModel",
165                             "|renderer": "function(v) { return String.format('{0}', v); }",
166                             "|xns": "Roo.grid"
167                         }
168                     ]
169                 }
170             ]
171         }
172     ],
173     "permname": "",
174     "modOrder": "900"
175 }