Pman.Tab.XtupleCurrency.bjs
[Pman.Xtuple] / Pman.Tab.XtupleCurrency.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.XtupleCurrency = new Roo.XComponent({
6     part     :  ["Xtuple","Currency"],
7     order    : '001-Pman.Tab.XtupleCurrency',
8     region   : '',
9     parent   : false,
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             layout : {
21                 xtype: 'BorderLayout',
22                 xns: Roo,
23                 items : [
24                     {
25                         xtype: 'GridPanel',
26                         xns: Roo,
27                         listeners : {
28                             activate : function() {
29                                 _this.panel = this;
30                                 if (_this.grid) {
31                                     _this.grid.footer.onClick('first');
32                                 }
33                             }
34                         },
35                         background : false,
36                         fitContainer : true,
37                         fitToframe : true,
38                         region : 'west',
39                         tableName : 'curr_symbol',
40                         title : "curr_symbol",
41                         grid : {
42                             xtype: 'Grid',
43                             xns: Roo.grid,
44                             autoExpandColumn : 'curr_name',
45                             loadMask : true,
46                             listeners : {
47                                 render : function() 
48                                 {
49                                     _this.grid = this; 
50                                     //_this.dialog = Pman.Dialog.FILL_IN
51                                     if (_this.panel.active) {
52                                        this.footer.onClick('first');
53                                     }
54                                 },
55                                 rowdblclick : function (_self, rowIndex, e)
56                                 {
57                                     if (!_this.dialog) return;
58                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
59                                         _this.grid.footer.onClick('first');
60                                     }); 
61                                 }
62                             },
63                             dataSource : {
64                                 xtype: 'Store',
65                                 xns: Roo.data,
66                                 remoteSort : true,
67                                 sortInfo : { field : 'curr_name', direction: 'ASC' },
68                                 proxy : {
69                                     xtype: 'HttpProxy',
70                                     xns: Roo.data,
71                                     method : 'GET',
72                                     url : baseURL + '/Roo/curr_symbol.php'
73                                 },
74                                 reader : {
75                                     xtype: 'JsonReader',
76                                     xns: Roo.data,
77                                     totalProperty : 'total',
78                                     root : 'data',
79                                     id : 'id',
80                                     fields : [
81                                         {
82                                             'name': 'curr_id',
83                                             'type': 'int'
84                                         },
85                                         {
86                                             'name': 'curr_base',
87                                             'type': 'int'
88                                         },
89                                         {
90                                             'name': 'curr_name',
91                                             'type': 'string'
92                                         },
93                                         {
94                                             'name': 'curr_symbol',
95                                             'type': 'string'
96                                         },
97                                         {
98                                             'name': 'curr_abbr',
99                                             'type': 'string'
100                                         }
101                                     ]
102                                 }
103                             },
104                             footer : {
105                                 xtype: 'PagingToolbar',
106                                 xns: Roo,
107                                 pageSize : 25,
108                                 displayInfo : true,
109                                 displayMsg : "Displaying curr_symbol{0} - {1} of {2}",
110                                 emptyMsg : "No curr_symbol found"
111                             },
112                             toolbar : {
113                                 xtype: 'Toolbar',
114                                 xns: Roo,
115                                 items : [
116                                     {
117                                         xtype: 'Fill',
118                                         xns: Roo.Toolbar
119                                     },
120                                     {
121                                         xtype: 'Button',
122                                         xns: Roo.Toolbar,
123                                         text : "Add",
124                                         cls : 'x-btn-text-icon',
125                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
126                                         listeners : {
127                                             click : function()
128                                             {
129                                                 if (!_this.dialog) return;
130                                                 _this.dialog.show( { id : 0 } , function() {
131                                                     _this.grid.footer.onClick('first');
132                                                }); 
133                                             }
134                                         }
135                                     }
136                                 ]
137                             },
138                             colModel : [
139                                 {
140                                     xtype: 'ColumnModel',
141                                     xns: Roo.grid,
142                                     header : 'Curr base',
143                                     width : 75,
144                                     dataIndex : 'curr_base',
145                                     renderer : function(v) { return String.format('{0}', v); }
146                                 },
147                                 {
148                                     xtype: 'ColumnModel',
149                                     xns: Roo.grid,
150                                     dataIndex : 'curr_name',
151                                     header : 'Curr name',
152                                     width : 200,
153                                     renderer : function(v,x,r) { 
154                                     
155                                         return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v); 
156                                         
157                                     }
158                                 },
159                                 {
160                                     xtype: 'ColumnModel',
161                                     xns: Roo.grid,
162                                     dataIndex : 'curr_symbol',
163                                     header : 'Curr symbol',
164                                     width : 200,
165                                     renderer : function(v,x,r) { 
166                                     
167                                         return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v); 
168                                         
169                                     }
170                                 },
171                                 {
172                                     xtype: 'ColumnModel',
173                                     xns: Roo.grid,
174                                     dataIndex : 'curr_abbr',
175                                     header : 'Curr abbr',
176                                     width : 200,
177                                     renderer : function(v,x,r) { 
178                                     
179                                         return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v); 
180                                         
181                                     }
182                                 }
183                             ]
184                         }
185                     },
186                     {
187                         xtype: 'GridPanel',
188                         xns: Roo,
189                         listeners : {
190                             activate : function() {
191                                 _this.rpanel = this;
192                                 if (_this.rgrid) {
193                                     _this.rgrid.footer.onClick('first');
194                                 }
195                             }
196                         },
197                         background : false,
198                         fitContainer : true,
199                         fitToframe : true,
200                         region : 'center',
201                         tableName : 'curr_rate',
202                         title : "curr_rate",
203                         grid : {
204                             xtype: 'Grid',
205                             xns: Roo.grid,
206                             listeners : {
207                                 render : function() 
208                                 {
209                                     _this.rgrid = this; 
210                                     //_this.dialog = Pman.Dialog.FILL_IN
211                                     if (_this.rpanel.active) {
212                                        this.footer.onClick('first');
213                                     }
214                                 },
215                                 rowdblclick : function (_self, rowIndex, e)
216                                 {
217                                     if (!_this.dialog) return;
218                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
219                                         _this.grid.footer.onClick('first');
220                                     }); 
221                                 }
222                             },
223                             autoExpandColumn : '',
224                             loadMask : true,
225                             dataSource : {
226                                 xtype: 'Store',
227                                 xns: Roo.data,
228                                 remoteSort : true,
229                                 sortInfo : { field : '', direction: 'ASC' },
230                                 proxy : {
231                                     xtype: 'HttpProxy',
232                                     xns: Roo.data,
233                                     method : 'GET',
234                                     url : baseURL + '/Roo/curr_rate.php'
235                                 },
236                                 reader : {
237                                     xtype: 'JsonReader',
238                                     xns: Roo.data,
239                                     totalProperty : 'total',
240                                     root : 'data',
241                                     id : 'id',
242                                     fields : [
243                                         {
244                                             'name': 'curr_rate_id',
245                                             'type': 'int'
246                                         },
247                                         {
248                                             'name': 'curr_id',
249                                             'type': 'int'
250                                         },
251                                         {
252                                             'name': 'curr_id',
253                                             'type': 'int'
254                                         },
255                                         {
256                                             'name': 'curr_rate',
257                                             'type': 'float'
258                                         },
259                                         {
260                                             'name': 'curr_effective',
261                                             'type': 'date',
262                                             'dateFormat': 'Y-m-d'
263                                         },
264                                         {
265                                             'name': 'curr_expires',
266                                             'type': 'date',
267                                             'dateFormat': 'Y-m-d'
268                                         }
269                                     ]
270                                 }
271                             },
272                             footer : {
273                                 xtype: 'PagingToolbar',
274                                 xns: Roo,
275                                 pageSize : 25,
276                                 displayInfo : true,
277                                 displayMsg : "Displaying curr_rate{0} - {1} of {2}",
278                                 emptyMsg : "No curr_rate found"
279                             },
280                             toolbar : {
281                                 xtype: 'Toolbar',
282                                 xns: Roo,
283                                 items : [
284                                     {
285                                         xtype: 'Fill',
286                                         xns: Roo.Toolbar
287                                     },
288                                     {
289                                         xtype: 'Button',
290                                         xns: Roo.Toolbar,
291                                         text : "Add",
292                                         cls : 'x-btn-text-icon',
293                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
294                                         listeners : {
295                                             click : function()
296                                             {
297                                                 if (!_this.dialog) return;
298                                                 _this.dialog.show( { id : 0 } , function() {
299                                                     _this.grid.footer.onClick('first');
300                                                }); 
301                                             }
302                                         }
303                                     }
304                                 ]
305                             },
306                             colModel : [
307                                 {
308                                     xtype: 'ColumnModel',
309                                     xns: Roo.grid,
310                                     header : 'Curr rate',
311                                     width : 75,
312                                     dataIndex : 'curr_rate_id',
313                                     renderer : function(v) { return String.format('{0}', v); }
314                                 },
315                                 {
316                                     xtype: 'ColumnModel',
317                                     xns: Roo.grid,
318                                     header : 'Curr',
319                                     width : 75,
320                                     dataIndex : 'curr_id',
321                                     renderer : function(v) { return String.format('{0}', v); }
322                                 },
323                                 {
324                                     xtype: 'ColumnModel',
325                                     xns: Roo.grid,
326                                     header : 'Curr',
327                                     width : 75,
328                                     dataIndex : 'curr_id',
329                                     renderer : function(v) { return String.format('{0}', v); }
330                                 },
331                                 {
332                                     xtype: 'ColumnModel',
333                                     xns: Roo.grid,
334                                     header : 'Curr rate',
335                                     width : 75,
336                                     dataIndex : 'curr_rate',
337                                     renderer : function(v) { return String.format('{0}', v); }
338                                 },
339                                 {
340                                     xtype: 'ColumnModel',
341                                     xns: Roo.grid,
342                                     header : 'Curr effective',
343                                     width : 75,
344                                     dataIndex : 'curr_effective',
345                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
346                                 },
347                                 {
348                                     xtype: 'ColumnModel',
349                                     xns: Roo.grid,
350                                     header : 'Curr expires',
351                                     width : 75,
352                                     dataIndex : 'curr_expires',
353                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
354                                 }
355                             ]
356                         }
357                     }
358                 ],
359                 west : {
360                     xtype: 'LayoutRegion',
361                     xns: Roo,
362                     width : 200
363                 },
364                 center : {
365                     xtype: 'LayoutRegion',
366                     xns: Roo
367                 }
368             }
369         };
370     }
371 });