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: 'Button',
164                                         xns: Roo.Toolbar,
165                                         text : "Add",
166                                         cls : 'x-btn-text-icon',
167                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
168                                         listeners : {
169                                             click : function()
170                                             {
171                                                 if (!_this.dialog) return;
172                                                 _this.dialog.show( { id : 0 } , function() {
173                                                     _this.grid.footer.onClick('first');
174                                                }); 
175                                             }
176                                         }
177                                     }
178                                 ]
179                             },
180                             colModel : [
181                                 {
182                                     xtype: 'ColumnModel',
183                                     xns: Roo.grid,
184                                     header : 'Report',
185                                     width : 75,
186                                     dataIndex : 'report_id',
187                                     renderer : function(v) { return String.format('{0}', v); }
188                                 },
189                                 {
190                                     xtype: 'ColumnModel',
191                                     xns: Roo.grid,
192                                     header : 'Report name',
193                                     width : 200,
194                                     dataIndex : 'report_name',
195                                     renderer : function(v) { return String.format('{0}', v); }
196                                 },
197                                 {
198                                     xtype: 'ColumnModel',
199                                     xns: Roo.grid,
200                                     header : 'Report descrip',
201                                     width : 200,
202                                     dataIndex : 'report_descrip',
203                                     renderer : function(v) { return String.format('{0}', v); }
204                                 }
205                             ]
206                         }
207                     },
208                     {
209                         xtype: 'GridPanel',
210                         xns: Roo,
211                         title : "report",
212                         fitToframe : true,
213                         fitContainer : true,
214                         tableName : 'report',
215                         background : true,
216                         region : 'center',
217                         listeners : {
218                             activate : function() {
219                                 _this.panel = this;
220                                 if (_this.grid) {
221                                     _this.grid.footer.onClick('first');
222                                 }
223                             }
224                         },
225                         grid : {
226                             xtype: 'Grid',
227                             xns: Roo.grid,
228                             autoExpandColumn : 'report_name',
229                             loadMask : true,
230                             listeners : {
231                                 render : function() 
232                                 {
233                                     _this.grid = this; 
234                                     //_this.dialog = Pman.Dialog.FILL_IN
235                                     if (_this.panel.active) {
236                                        this.footer.onClick('first');
237                                     }
238                                 },
239                                 rowdblclick : function (_self, rowIndex, e)
240                                 {
241                                     if (!_this.dialog) return;
242                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
243                                         _this.grid.footer.onClick('first');
244                                     }); 
245                                 }
246                             },
247                             dataSource : {
248                                 xtype: 'Store',
249                                 xns: Roo.data,
250                                 remoteSort : true,
251                                 sortInfo : { field : 'report_name', direction: 'ASC' },
252                                 proxy : {
253                                     xtype: 'HttpProxy',
254                                     xns: Roo.data,
255                                     method : 'GET',
256                                     url : baseURL + '/Roo/report.php'
257                                 },
258                                 reader : {
259                                     xtype: 'JsonReader',
260                                     xns: Roo.data,
261                                     totalProperty : 'total',
262                                     root : 'data',
263                                     id : 'id',
264                                     fields : [
265                                         {
266                                             'name': 'report_id',
267                                             'type': 'int'
268                                         },
269                                         {
270                                             'name': 'report_name',
271                                             'type': 'string'
272                                         },
273                                         {
274                                             'name': 'report_sys',
275                                             'type': 'int'
276                                         },
277                                         {
278                                             'name': 'report_source',
279                                             'type': 'string'
280                                         },
281                                         {
282                                             'name': 'report_descrip',
283                                             'type': 'string'
284                                         },
285                                         {
286                                             'name': 'report_grade',
287                                             'type': 'int'
288                                         },
289                                         {
290                                             'name': 'report_loaddate',
291                                             'type': 'date',
292                                             'dateFormat': 'Y-m-d'
293                                         }
294                                     ]
295                                 }
296                             },
297                             footer : {
298                                 xtype: 'PagingToolbar',
299                                 xns: Roo,
300                                 pageSize : 25,
301                                 displayInfo : true,
302                                 displayMsg : "Displaying report{0} - {1} of {2}",
303                                 emptyMsg : "No report found"
304                             },
305                             colModel : [
306                                 {
307                                     xtype: 'ColumnModel',
308                                     xns: Roo.grid,
309                                     header : 'Report grade',
310                                     width : 75,
311                                     dataIndex : 'report_grade',
312                                     renderer : function(v) { return String.format('{0}', v); }
313                                 },
314                                 {
315                                     xtype: 'ColumnModel',
316                                     xns: Roo.grid,
317                                     header : 'Report loaddate',
318                                     width : 75,
319                                     dataIndex : 'report_loaddate',
320                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
321                                 }
322                             ]
323                         }
324                     }
325                 ],
326                 center : {
327                     xtype: 'LayoutRegion',
328                     xns: Roo
329                 },
330                 east : {
331                     xtype: 'LayoutRegion',
332                     xns: Roo,
333                     title : "Versions",
334                     titlebar : true,
335                     width : 150
336                 }
337             }
338         };
339     }
340 });