Pman.Tab.XtupleReports.bjs
[Pman.Xtuple] / Pman.Tab.XtupleReports.bjs
1 {
2     "id": "roo-file-527",
3     "name": "Pman.Tab.XtupleReports",
4     "parent": "",
5     "title": "",
6     "path": "/home/alan/gitlive/web.xtuple/Pman/Xtuple/Pman.Tab.XtupleReports.bjs",
7     "items": [
8         {
9             "title": "Reports",
10             "xtype": "NestedLayoutPanel",
11             "|xns": "Roo",
12             "items": [
13                 {
14                     "|xns": "Roo",
15                     "xtype": "BorderLayout",
16                     "*prop": "layout",
17                     "items": [
18                         {
19                             "|xns": "Roo",
20                             "xtype": "LayoutRegion",
21                             "*prop": "center"
22                         },
23                         {
24                             "*prop": "east",
25                             "title": "Versions",
26                             "titlebar": true,
27                             "width": 150,
28                             "xtype": "LayoutRegion",
29                             "|xns": "Roo"
30                         },
31                         {
32                             "|xns": "Roo",
33                             "xtype": "GridPanel",
34                             "title": "report",
35                             "fitToframe": true,
36                             "fitContainer": true,
37                             "tableName": "report",
38                             "background": true,
39                             "region": "center",
40                             "listeners": {
41                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
42                             },
43                             "items": [
44                                 {
45                                     "*prop": "grid",
46                                     "xtype": "Grid",
47                                     "autoExpandColumn": "report_name",
48                                     "loadMask": true,
49                                     "listeners": {
50                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
51                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
52                                     },
53                                     "|xns": "Roo.grid",
54                                     "items": [
55                                         {
56                                             "*prop": "dataSource",
57                                             "xtype": "Store",
58                                             "remoteSort": true,
59                                             "|sortInfo": "{ field : 'report_name', direction: 'ASC' }",
60                                             "|xns": "Roo.data",
61                                             "items": [
62                                                 {
63                                                     "*prop": "proxy",
64                                                     "xtype": "HttpProxy",
65                                                     "method": "GET",
66                                                     "|url": "baseURL + '/Roo/report.php'",
67                                                     "|xns": "Roo.data"
68                                                 },
69                                                 {
70                                                     "|xns": "Roo.data",
71                                                     "xtype": "JsonReader",
72                                                     "totalProperty": "total",
73                                                     "root": "data",
74                                                     "*prop": "reader",
75                                                     "id": "id",
76                                                     "|fields": "[\n    {\n        'name': 'report_id',\n        'type': 'int'\n    },\n    {\n        'name': 'report_name',\n        'type': 'string'\n    },\n    {\n        'name': 'report_sys',\n        'type': 'int'\n    },\n    {\n        'name': 'report_source',\n        'type': 'string'\n    },\n    {\n        'name': 'report_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'report_grade',\n        'type': 'int'\n    },\n    {\n        'name': 'report_loaddate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    }\n]"
77                                                 }
78                                             ]
79                                         },
80                                         {
81                                             "*prop": "footer",
82                                             "xtype": "PagingToolbar",
83                                             "pageSize": 25,
84                                             "displayInfo": true,
85                                             "displayMsg": "Displaying report{0} - {1} of {2}",
86                                             "emptyMsg": "No report found",
87                                             "|xns": "Roo"
88                                         },
89                                         {
90                                             "*prop": "toolbar",
91                                             "xtype": "Toolbar",
92                                             "|xns": "Roo",
93                                             "items": [
94                                                 {
95                                                     "text": "Add",
96                                                     "xtype": "Button",
97                                                     "cls": "x-btn-text-icon",
98                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
99                                                     "listeners": {
100                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
101                                                     },
102                                                     "|xns": "Roo.Toolbar"
103                                                 },
104                                                 {
105                                                     "text": "Edit",
106                                                     "xtype": "Button",
107                                                     "cls": "x-btn-text-icon",
108                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
109                                                     "listeners": {
110                                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
111                                                     },
112                                                     "|xns": "Roo.Toolbar"
113                                                 },
114                                                 {
115                                                     "text": "Delete",
116                                                     "cls": "x-btn-text-icon",
117                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
118                                                     "xtype": "Button",
119                                                     "listeners": {
120                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'report'); \n}\n        "
121                                                     },
122                                                     "|xns": "Roo.Toolbar"
123                                                 }
124                                             ]
125                                         },
126                                         {
127                                             "xtype": "ColumnModel",
128                                             "header": "Report",
129                                             "width": 75,
130                                             "dataIndex": "report_id",
131                                             "|renderer": "function(v) { return String.format('{0}', v); }",
132                                             "|xns": "Roo.grid",
133                                             "*prop": "colModel[]"
134                                         },
135                                         {
136                                             "xtype": "ColumnModel",
137                                             "header": "Report name",
138                                             "width": 200,
139                                             "dataIndex": "report_name",
140                                             "|renderer": "function(v) { return String.format('{0}', v); }",
141                                             "|xns": "Roo.grid",
142                                             "*prop": "colModel[]"
143                                         },
144                                         {
145                                             "xtype": "ColumnModel",
146                                             "header": "Report sys",
147                                             "width": 75,
148                                             "dataIndex": "report_sys",
149                                             "|renderer": "function(v) { return String.format('{0}', v); }",
150                                             "|xns": "Roo.grid",
151                                             "*prop": "colModel[]"
152                                         },
153                                         {
154                                             "xtype": "ColumnModel",
155                                             "header": "Report source",
156                                             "width": 200,
157                                             "dataIndex": "report_source",
158                                             "|renderer": "function(v) { return String.format('{0}', v); }",
159                                             "|xns": "Roo.grid",
160                                             "*prop": "colModel[]"
161                                         },
162                                         {
163                                             "xtype": "ColumnModel",
164                                             "header": "Report descrip",
165                                             "width": 200,
166                                             "dataIndex": "report_descrip",
167                                             "|renderer": "function(v) { return String.format('{0}', v); }",
168                                             "|xns": "Roo.grid",
169                                             "*prop": "colModel[]"
170                                         }
171                                     ]
172                                 }
173                             ]
174                         },
175                         {
176                             "|xns": "Roo",
177                             "xtype": "GridPanel",
178                             "title": "report",
179                             "fitToframe": true,
180                             "fitContainer": true,
181                             "tableName": "report",
182                             "background": true,
183                             "region": "center",
184                             "listeners": {
185                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
186                             },
187                             "items": [
188                                 {
189                                     "*prop": "grid",
190                                     "xtype": "Grid",
191                                     "autoExpandColumn": "report_name",
192                                     "loadMask": true,
193                                     "listeners": {
194                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
195                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
196                                     },
197                                     "|xns": "Roo.grid",
198                                     "items": [
199                                         {
200                                             "*prop": "dataSource",
201                                             "xtype": "Store",
202                                             "remoteSort": true,
203                                             "|sortInfo": "{ field : 'report_name', direction: 'ASC' }",
204                                             "|xns": "Roo.data",
205                                             "items": [
206                                                 {
207                                                     "*prop": "proxy",
208                                                     "xtype": "HttpProxy",
209                                                     "method": "GET",
210                                                     "|url": "baseURL + '/Roo/report.php'",
211                                                     "|xns": "Roo.data"
212                                                 },
213                                                 {
214                                                     "|xns": "Roo.data",
215                                                     "xtype": "JsonReader",
216                                                     "totalProperty": "total",
217                                                     "root": "data",
218                                                     "*prop": "reader",
219                                                     "id": "id",
220                                                     "|fields": "[\n    {\n        'name': 'report_id',\n        'type': 'int'\n    },\n    {\n        'name': 'report_name',\n        'type': 'string'\n    },\n    {\n        'name': 'report_sys',\n        'type': 'int'\n    },\n    {\n        'name': 'report_source',\n        'type': 'string'\n    },\n    {\n        'name': 'report_descrip',\n        'type': 'string'\n    },\n    {\n        'name': 'report_grade',\n        'type': 'int'\n    },\n    {\n        'name': 'report_loaddate',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    }\n]"
221                                                 }
222                                             ]
223                                         },
224                                         {
225                                             "*prop": "footer",
226                                             "xtype": "PagingToolbar",
227                                             "pageSize": 25,
228                                             "displayInfo": true,
229                                             "displayMsg": "Displaying report{0} - {1} of {2}",
230                                             "emptyMsg": "No report found",
231                                             "|xns": "Roo"
232                                         },
233                                         {
234                                             "xtype": "ColumnModel",
235                                             "header": "Report grade",
236                                             "width": 75,
237                                             "dataIndex": "report_grade",
238                                             "|renderer": "function(v) { return String.format('{0}', v); }",
239                                             "|xns": "Roo.grid",
240                                             "*prop": "colModel[]"
241                                         },
242                                         {
243                                             "xtype": "ColumnModel",
244                                             "header": "Report loaddate",
245                                             "width": 75,
246                                             "dataIndex": "report_loaddate",
247                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
248                                             "|xns": "Roo.grid",
249                                             "*prop": "colModel[]"
250                                         }
251                                     ]
252                                 }
253                             ]
254                         }
255                     ]
256                 }
257             ]
258         }
259     ],
260     "permname": "",
261     "modOrder": "001"
262 }