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