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    var r = e.record.data.poitem_qty_received * 1;\n    \n    if(r > 0){\n        Roo.MessageBox.alert(\"Error\", \"This item has been receipted\");\n        return false;\n    }\n    \n    var status = _this.form.findField('pohead_status').getValue();\n    \n    if(status == 'C'){\n        Roo.MessageBox.alert(\"Error\", \"This PO has been closed\");\n        return false;\n    }\n    \n    \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}\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                         },
77                         {
78                             "*prop": "footer",
79                             "displayInfo": true,
80                             "emptyMsg": "No Metric found",
81                             "pageSize": 50,
82                             "xtype": "PagingToolbar",
83                             "|xns": "Roo"
84                         },
85                         {
86                             "*prop": "colModel[]",
87                             "dataIndex": "metric_id",
88                             "header": "ID",
89                             "width": 75,
90                             "xtype": "ColumnModel",
91                             "|renderer": "function(v) { return String.format('{0}', v); }",
92                             "|xns": "Roo.grid"
93                         },
94                         {
95                             "*prop": "colModel[]",
96                             "dataIndex": "metric_name",
97                             "header": "Name",
98                             "width": 150,
99                             "xtype": "ColumnModel",
100                             "|renderer": "function(v) { return String.format('{0}', v); }",
101                             "|xns": "Roo.grid"
102                         },
103                         {
104                             "*prop": "colModel[]",
105                             "dataIndex": "metric_value",
106                             "header": "Value",
107                             "width": 150,
108                             "xtype": "ColumnModel",
109                             "|renderer": "function(v) { return String.format('{0}', v); }",
110                             "|xns": "Roo.grid"
111                         },
112                         {
113                             "*prop": "colModel[]",
114                             "dataIndex": "metric_module",
115                             "header": "Module",
116                             "width": 100,
117                             "xtype": "ColumnModel",
118                             "|renderer": "function(v) { return String.format('{0}', v); }",
119                             "|xns": "Roo.grid"
120                         }
121                     ]
122                 }
123             ]
124         }
125     ],
126     "permname": "",
127     "modOrder": "900"
128 }