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