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                             "xtype": "LayoutRegion",
26                             "|xns": "Roo"
27                         },
28                         {
29                             "|xns": "Roo",
30                             "xtype": "GridPanel",
31                             "title": "report",
32                             "fitToframe": true,
33                             "fitContainer": true,
34                             "tableName": "report",
35                             "background": true,
36                             "region": "center",
37                             "listeners": {
38                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
39                             },
40                             "items": [
41                                 {
42                                     "*prop": "grid",
43                                     "xtype": "Grid",
44                                     "autoExpandColumn": "report_name",
45                                     "loadMask": true,
46                                     "listeners": {
47                                         "|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}",
48                                         "|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"
49                                     },
50                                     "|xns": "Roo.grid",
51                                     "items": [
52                                         {
53                                             "*prop": "dataSource",
54                                             "xtype": "Store",
55                                             "remoteSort": true,
56                                             "|sortInfo": "{ field : 'report_name', direction: 'ASC' }",
57                                             "|xns": "Roo.data",
58                                             "items": [
59                                                 {
60                                                     "*prop": "proxy",
61                                                     "xtype": "HttpProxy",
62                                                     "method": "GET",
63                                                     "|url": "baseURL + '/Roo/report.php'",
64                                                     "|xns": "Roo.data"
65                                                 },
66                                                 {
67                                                     "|xns": "Roo.data",
68                                                     "xtype": "JsonReader",
69                                                     "totalProperty": "total",
70                                                     "root": "data",
71                                                     "*prop": "reader",
72                                                     "id": "id",
73                                                     "|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]"
74                                                 }
75                                             ]
76                                         },
77                                         {
78                                             "*prop": "footer",
79                                             "xtype": "PagingToolbar",
80                                             "pageSize": 25,
81                                             "displayInfo": true,
82                                             "displayMsg": "Displaying report{0} - {1} of {2}",
83                                             "emptyMsg": "No report found",
84                                             "|xns": "Roo"
85                                         },
86                                         {
87                                             "*prop": "toolbar",
88                                             "xtype": "Toolbar",
89                                             "|xns": "Roo",
90                                             "items": [
91                                                 {
92                                                     "text": "Add",
93                                                     "xtype": "Button",
94                                                     "cls": "x-btn-text-icon",
95                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
96                                                     "listeners": {
97                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
98                                                     },
99                                                     "|xns": "Roo.Toolbar"
100                                                 },
101                                                 {
102                                                     "text": "Edit",
103                                                     "xtype": "Button",
104                                                     "cls": "x-btn-text-icon",
105                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
106                                                     "listeners": {
107                                                         "|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"
108                                                     },
109                                                     "|xns": "Roo.Toolbar"
110                                                 },
111                                                 {
112                                                     "text": "Delete",
113                                                     "cls": "x-btn-text-icon",
114                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
115                                                     "xtype": "Button",
116                                                     "listeners": {
117                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'report'); \n}\n        "
118                                                     },
119                                                     "|xns": "Roo.Toolbar"
120                                                 }
121                                             ]
122                                         },
123                                         {
124                                             "xtype": "ColumnModel",
125                                             "header": "Report",
126                                             "width": 75,
127                                             "dataIndex": "report_id",
128                                             "|renderer": "function(v) { return String.format('{0}', v); }",
129                                             "|xns": "Roo.grid",
130                                             "*prop": "colModel[]"
131                                         },
132                                         {
133                                             "xtype": "ColumnModel",
134                                             "header": "Report name",
135                                             "width": 200,
136                                             "dataIndex": "report_name",
137                                             "|renderer": "function(v) { return String.format('{0}', v); }",
138                                             "|xns": "Roo.grid",
139                                             "*prop": "colModel[]"
140                                         },
141                                         {
142                                             "xtype": "ColumnModel",
143                                             "header": "Report sys",
144                                             "width": 75,
145                                             "dataIndex": "report_sys",
146                                             "|renderer": "function(v) { return String.format('{0}', v); }",
147                                             "|xns": "Roo.grid",
148                                             "*prop": "colModel[]"
149                                         },
150                                         {
151                                             "xtype": "ColumnModel",
152                                             "header": "Report source",
153                                             "width": 200,
154                                             "dataIndex": "report_source",
155                                             "|renderer": "function(v) { return String.format('{0}', v); }",
156                                             "|xns": "Roo.grid",
157                                             "*prop": "colModel[]"
158                                         },
159                                         {
160                                             "xtype": "ColumnModel",
161                                             "header": "Report descrip",
162                                             "width": 200,
163                                             "dataIndex": "report_descrip",
164                                             "|renderer": "function(v) { return String.format('{0}', v); }",
165                                             "|xns": "Roo.grid",
166                                             "*prop": "colModel[]"
167                                         },
168                                         {
169                                             "xtype": "ColumnModel",
170                                             "header": "Report grade",
171                                             "width": 75,
172                                             "dataIndex": "report_grade",
173                                             "|renderer": "function(v) { return String.format('{0}', v); }",
174                                             "|xns": "Roo.grid",
175                                             "*prop": "colModel[]"
176                                         },
177                                         {
178                                             "xtype": "ColumnModel",
179                                             "header": "Report loaddate",
180                                             "width": 75,
181                                             "dataIndex": "report_loaddate",
182                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
183                                             "|xns": "Roo.grid",
184                                             "*prop": "colModel[]"
185                                         }
186                                     ]
187                                 }
188                             ]
189                         },
190                         {
191                             "|xns": "Roo",
192                             "xtype": "GridPanel",
193                             "title": "report",
194                             "fitToframe": true,
195                             "fitContainer": true,
196                             "tableName": "report",
197                             "background": true,
198                             "region": "center",
199                             "listeners": {
200                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
201                             },
202                             "items": [
203                                 {
204                                     "*prop": "grid",
205                                     "xtype": "Grid",
206                                     "autoExpandColumn": "report_name",
207                                     "loadMask": true,
208                                     "listeners": {
209                                         "|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}",
210                                         "|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"
211                                     },
212                                     "|xns": "Roo.grid",
213                                     "items": [
214                                         {
215                                             "*prop": "dataSource",
216                                             "xtype": "Store",
217                                             "remoteSort": true,
218                                             "|sortInfo": "{ field : 'report_name', direction: 'ASC' }",
219                                             "|xns": "Roo.data",
220                                             "items": [
221                                                 {
222                                                     "*prop": "proxy",
223                                                     "xtype": "HttpProxy",
224                                                     "method": "GET",
225                                                     "|url": "baseURL + '/Roo/report.php'",
226                                                     "|xns": "Roo.data"
227                                                 },
228                                                 {
229                                                     "|xns": "Roo.data",
230                                                     "xtype": "JsonReader",
231                                                     "totalProperty": "total",
232                                                     "root": "data",
233                                                     "*prop": "reader",
234                                                     "id": "id",
235                                                     "|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]"
236                                                 }
237                                             ]
238                                         },
239                                         {
240                                             "*prop": "footer",
241                                             "xtype": "PagingToolbar",
242                                             "pageSize": 25,
243                                             "displayInfo": true,
244                                             "displayMsg": "Displaying report{0} - {1} of {2}",
245                                             "emptyMsg": "No report found",
246                                             "|xns": "Roo"
247                                         },
248                                         {
249                                             "*prop": "toolbar",
250                                             "xtype": "Toolbar",
251                                             "|xns": "Roo",
252                                             "items": [
253                                                 {
254                                                     "text": "Add",
255                                                     "xtype": "Button",
256                                                     "cls": "x-btn-text-icon",
257                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
258                                                     "listeners": {
259                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
260                                                     },
261                                                     "|xns": "Roo.Toolbar"
262                                                 },
263                                                 {
264                                                     "text": "Edit",
265                                                     "xtype": "Button",
266                                                     "cls": "x-btn-text-icon",
267                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
268                                                     "listeners": {
269                                                         "|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"
270                                                     },
271                                                     "|xns": "Roo.Toolbar"
272                                                 },
273                                                 {
274                                                     "text": "Delete",
275                                                     "cls": "x-btn-text-icon",
276                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
277                                                     "xtype": "Button",
278                                                     "listeners": {
279                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'report'); \n}\n        "
280                                                     },
281                                                     "|xns": "Roo.Toolbar"
282                                                 }
283                                             ]
284                                         },
285                                         {
286                                             "xtype": "ColumnModel",
287                                             "header": "Report",
288                                             "width": 75,
289                                             "dataIndex": "report_id",
290                                             "|renderer": "function(v) { return String.format('{0}', v); }",
291                                             "|xns": "Roo.grid",
292                                             "*prop": "colModel[]"
293                                         },
294                                         {
295                                             "xtype": "ColumnModel",
296                                             "header": "Report name",
297                                             "width": 200,
298                                             "dataIndex": "report_name",
299                                             "|renderer": "function(v) { return String.format('{0}', v); }",
300                                             "|xns": "Roo.grid",
301                                             "*prop": "colModel[]"
302                                         },
303                                         {
304                                             "xtype": "ColumnModel",
305                                             "header": "Report sys",
306                                             "width": 75,
307                                             "dataIndex": "report_sys",
308                                             "|renderer": "function(v) { return String.format('{0}', v); }",
309                                             "|xns": "Roo.grid",
310                                             "*prop": "colModel[]"
311                                         },
312                                         {
313                                             "xtype": "ColumnModel",
314                                             "header": "Report source",
315                                             "width": 200,
316                                             "dataIndex": "report_source",
317                                             "|renderer": "function(v) { return String.format('{0}', v); }",
318                                             "|xns": "Roo.grid",
319                                             "*prop": "colModel[]"
320                                         },
321                                         {
322                                             "xtype": "ColumnModel",
323                                             "header": "Report descrip",
324                                             "width": 200,
325                                             "dataIndex": "report_descrip",
326                                             "|renderer": "function(v) { return String.format('{0}', v); }",
327                                             "|xns": "Roo.grid",
328                                             "*prop": "colModel[]"
329                                         },
330                                         {
331                                             "xtype": "ColumnModel",
332                                             "header": "Report grade",
333                                             "width": 75,
334                                             "dataIndex": "report_grade",
335                                             "|renderer": "function(v) { return String.format('{0}', v); }",
336                                             "|xns": "Roo.grid",
337                                             "*prop": "colModel[]"
338                                         },
339                                         {
340                                             "xtype": "ColumnModel",
341                                             "header": "Report loaddate",
342                                             "width": 75,
343                                             "dataIndex": "report_loaddate",
344                                             "|renderer": "function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }",
345                                             "|xns": "Roo.grid",
346                                             "*prop": "colModel[]"
347                                         }
348                                     ]
349                                 }
350                             ]
351                         }
352                     ]
353                 }
354             ]
355         }
356     ],
357     "permname": "",
358     "modOrder": "001"
359 }