Pman.Tab.XtupleReports.bjs
[Pman.Xtuple] / Pman.Tab.XtupleReports.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Pman.Tab.XtupleReports = new Roo.XComponent({
6     part     :  ["Xtuple","Reports"],
7     order    : '500-Pman.Tab.XtupleReports',
8     region   : 'center',
9     parent   : 'Pman.Tab.Admin',
10     name     : "unnamed module",
11     disabled : false, 
12     permname : '', 
13     _tree : function()
14     {
15         var _this = this;
16         var MODULE = this;
17         return {
18             xtype: 'NestedLayoutPanel',
19             xns: Roo,
20             title : "Reports",
21             layout : {
22                 xtype: 'BorderLayout',
23                 xns: Roo,
24                 items : [
25                     {
26                         xtype: 'GridPanel',
27                         xns: Roo,
28                         title : "report",
29                         fitToframe : true,
30                         fitContainer : true,
31                         tableName : 'report',
32                         background : true,
33                         region : 'center',
34                         listeners : {
35                             activate : function() {
36                                 _this.panel = this;
37                                 if (_this.grid) {
38                                     _this.grid.footer.onClick('first');
39                                 }
40                             }
41                         },
42                         grid : {
43                             xtype: 'Grid',
44                             xns: Roo.grid,
45                             autoExpandColumn : 'report_name',
46                             loadMask : true,
47                             listeners : {
48                                 render : function() 
49                                 {
50                                     _this.grid = this; 
51                                     //_this.dialog = Pman.Dialog.FILL_IN
52                                     if (_this.panel.active) {
53                                        this.footer.onClick('first');
54                                     }
55                                 },
56                                 rowdblclick : function (_self, rowIndex, e)
57                                 {
58                                     if (!_this.dialog) return;
59                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
60                                         _this.grid.footer.onClick('first');
61                                     }); 
62                                 }
63                             },
64                             dataSource : {
65                                 xtype: 'Store',
66                                 xns: Roo.data,
67                                 remoteSort : true,
68                                 sortInfo : { field : 'report_name', direction: 'ASC' },
69                                 proxy : {
70                                     xtype: 'HttpProxy',
71                                     xns: Roo.data,
72                                     method : 'GET',
73                                     url : baseURL + '/Roo/report.php'
74                                 },
75                                 reader : {
76                                     xtype: 'JsonReader',
77                                     xns: Roo.data,
78                                     totalProperty : 'total',
79                                     root : 'data',
80                                     id : 'id',
81                                     fields : [
82                                         {
83                                             'name': 'report_id',
84                                             'type': 'int'
85                                         },
86                                         {
87                                             'name': 'report_name',
88                                             'type': 'string'
89                                         },
90                                         {
91                                             'name': 'report_sys',
92                                             'type': 'int'
93                                         },
94                                         {
95                                             'name': 'report_source',
96                                             'type': 'string'
97                                         },
98                                         {
99                                             'name': 'report_descrip',
100                                             'type': 'string'
101                                         },
102                                         {
103                                             'name': 'report_grade',
104                                             'type': 'int'
105                                         },
106                                         {
107                                             'name': 'report_loaddate',
108                                             'type': 'date',
109                                             'dateFormat': 'Y-m-d'
110                                         }
111                                     ]
112                                 }
113                             },
114                             footer : {
115                                 xtype: 'PagingToolbar',
116                                 xns: Roo,
117                                 pageSize : 25,
118                                 displayInfo : true,
119                                 displayMsg : "Displaying report{0} - {1} of {2}",
120                                 emptyMsg : "No report found"
121                             },
122                             toolbar : {
123                                 xtype: 'Toolbar',
124                                 xns: Roo,
125                                 items : [
126                                     {
127                                         xtype: 'TextField',
128                                         xns: Roo.form
129                                     },
130                                     {
131                                         xtype: 'Button',
132                                         xns: Roo.Toolbar,
133                                         listeners : {
134                                             click : function (_self, e)
135                                             {
136                                             _this.grid.footer.onClick('first');
137                                             }
138                                         },
139                                         cls : 'x-btn-icon',
140                                         icon : rootURL + '/Pman/templates/images/search.gif'
141                                     },
142                                     {
143                                         xtype: 'Button',
144                                         xns: Roo.Toolbar,
145                                         listeners : {
146                                             click : function (_self, e)
147                                             {
148                                                 _this.searchBox.setValue('');
149                                                 _this.publication_name_combo.setValue('');
150                                                 _this.publication_lang_combo.setValue('');
151                                                 _this.country_combo.setValue('');
152                                                 _this.category_media_id_combo.setValue('');
153                                                 _this.role_combo.setValue('');      
154                                             
155                                                 
156                                                 _this.grid.footer.onClick('first');
157                                             }
158                                         },
159                                         cls : 'x-btn-icon',
160                                         icon : rootURL + '/Pman/templates/images/edit-clear.gif'
161                                     },
162                                     {
163                                         xtype: 'Fill',
164                                         xns: Roo.Toolbar
165                                     },
166                                     {
167                                         xtype: 'Button',
168                                         xns: Roo.Toolbar,
169                                         text : "Add",
170                                         cls : 'x-btn-text-icon',
171                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
172                                         listeners : {
173                                             click : function()
174                                             {
175                                                 if (!_this.dialog) return;
176                                                 _this.dialog.show( { id : 0 } , function() {
177                                                     _this.grid.footer.onClick('first');
178                                                }); 
179                                             }
180                                         }
181                                     }
182                                 ]
183                             },
184                             colModel : [
185                                 {
186                                     xtype: 'ColumnModel',
187                                     xns: Roo.grid,
188                                     header : 'Report',
189                                     width : 75,
190                                     dataIndex : 'report_id',
191                                     renderer : function(v) { return String.format('{0}', v); }
192                                 },
193                                 {
194                                     xtype: 'ColumnModel',
195                                     xns: Roo.grid,
196                                     header : 'Report name',
197                                     width : 200,
198                                     dataIndex : 'report_name',
199                                     renderer : function(v) { return String.format('{0}', v); }
200                                 },
201                                 {
202                                     xtype: 'ColumnModel',
203                                     xns: Roo.grid,
204                                     header : 'Report descrip',
205                                     width : 200,
206                                     dataIndex : 'report_descrip',
207                                     renderer : function(v) { return String.format('{0}', v); }
208                                 }
209                             ]
210                         }
211                     },
212                     {
213                         xtype: 'GridPanel',
214                         xns: Roo,
215                         title : "report",
216                         fitToframe : true,
217                         fitContainer : true,
218                         tableName : 'report',
219                         background : true,
220                         region : 'center',
221                         listeners : {
222                             activate : function() {
223                                 _this.panel = this;
224                                 if (_this.grid) {
225                                     _this.grid.footer.onClick('first');
226                                 }
227                             }
228                         },
229                         grid : {
230                             xtype: 'Grid',
231                             xns: Roo.grid,
232                             autoExpandColumn : 'report_name',
233                             loadMask : true,
234                             listeners : {
235                                 render : function() 
236                                 {
237                                     _this.grid = this; 
238                                     //_this.dialog = Pman.Dialog.FILL_IN
239                                     if (_this.panel.active) {
240                                        this.footer.onClick('first');
241                                     }
242                                 },
243                                 rowdblclick : function (_self, rowIndex, e)
244                                 {
245                                     if (!_this.dialog) return;
246                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
247                                         _this.grid.footer.onClick('first');
248                                     }); 
249                                 }
250                             },
251                             dataSource : {
252                                 xtype: 'Store',
253                                 xns: Roo.data,
254                                 remoteSort : true,
255                                 sortInfo : { field : 'report_name', direction: 'ASC' },
256                                 proxy : {
257                                     xtype: 'HttpProxy',
258                                     xns: Roo.data,
259                                     method : 'GET',
260                                     url : baseURL + '/Roo/report.php'
261                                 },
262                                 reader : {
263                                     xtype: 'JsonReader',
264                                     xns: Roo.data,
265                                     totalProperty : 'total',
266                                     root : 'data',
267                                     id : 'id',
268                                     fields : [
269                                         {
270                                             'name': 'report_id',
271                                             'type': 'int'
272                                         },
273                                         {
274                                             'name': 'report_name',
275                                             'type': 'string'
276                                         },
277                                         {
278                                             'name': 'report_sys',
279                                             'type': 'int'
280                                         },
281                                         {
282                                             'name': 'report_source',
283                                             'type': 'string'
284                                         },
285                                         {
286                                             'name': 'report_descrip',
287                                             'type': 'string'
288                                         },
289                                         {
290                                             'name': 'report_grade',
291                                             'type': 'int'
292                                         },
293                                         {
294                                             'name': 'report_loaddate',
295                                             'type': 'date',
296                                             'dateFormat': 'Y-m-d'
297                                         }
298                                     ]
299                                 }
300                             },
301                             footer : {
302                                 xtype: 'PagingToolbar',
303                                 xns: Roo,
304                                 pageSize : 25,
305                                 displayInfo : true,
306                                 displayMsg : "Displaying report{0} - {1} of {2}",
307                                 emptyMsg : "No report found"
308                             },
309                             colModel : [
310                                 {
311                                     xtype: 'ColumnModel',
312                                     xns: Roo.grid,
313                                     header : 'Report grade',
314                                     width : 75,
315                                     dataIndex : 'report_grade',
316                                     renderer : function(v) { return String.format('{0}', v); }
317                                 },
318                                 {
319                                     xtype: 'ColumnModel',
320                                     xns: Roo.grid,
321                                     header : 'Report loaddate',
322                                     width : 75,
323                                     dataIndex : 'report_loaddate',
324                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
325                                 }
326                             ]
327                         }
328                     }
329                 ],
330                 center : {
331                     xtype: 'LayoutRegion',
332                     xns: Roo
333                 },
334                 east : {
335                     xtype: 'LayoutRegion',
336                     xns: Roo,
337                     title : "Versions",
338                     titlebar : true,
339                     width : 150
340                 }
341             }
342         };
343     }
344 });