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