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                                     dataIndex : 'curr_name',
143                                     header : 'Name',
144                                     width : 80,
145                                     renderer : function(v,x,r) { 
146                                     
147                                         return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v); 
148                                         
149                                     }
150                                 },
151                                 {
152                                     xtype: 'ColumnModel',
153                                     xns: Roo.grid,
154                                     dataIndex : 'curr_symbol',
155                                     header : 'Symbol',
156                                     width : 80,
157                                     renderer : function(v,x,r) { 
158                                     
159                                         return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v); 
160                                         
161                                     }
162                                 },
163                                 {
164                                     xtype: 'ColumnModel',
165                                     xns: Roo.grid,
166                                     dataIndex : 'curr_abbr',
167                                     header : 'Abbr.',
168                                     width : 80,
169                                     renderer : function(v,x,r) { 
170                                     
171                                         return String.format(r.data.curr_base*1 ? '<span style="color:red">{0}</span>' : '{0}', v); 
172                                         
173                                     }
174                                 }
175                             ]
176                         }
177                     },
178                     {
179                         xtype: 'GridPanel',
180                         xns: Roo,
181                         listeners : {
182                             activate : function() {
183                                 _this.rpanel = this;
184                                 if (_this.rgrid) {
185                                     _this.rgrid.footer.onClick('first');
186                                 }
187                             }
188                         },
189                         background : false,
190                         fitContainer : true,
191                         fitToframe : true,
192                         region : 'center',
193                         tableName : 'curr_rate',
194                         title : "curr_rate",
195                         grid : {
196                             xtype: 'Grid',
197                             xns: Roo.grid,
198                             listeners : {
199                                 render : function() 
200                                 {
201                                     _this.rgrid = this; 
202                                     //_this.dialog = Pman.Dialog.FILL_IN
203                                     if (_this.rpanel.active) {
204                                        this.footer.onClick('first');
205                                     }
206                                 },
207                                 rowdblclick : function (_self, rowIndex, e)
208                                 {
209                                     if (!_this.dialog) return;
210                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
211                                         _this.grid.footer.onClick('first');
212                                     }); 
213                                 }
214                             },
215                             autoExpandColumn : '',
216                             loadMask : true,
217                             dataSource : {
218                                 xtype: 'Store',
219                                 xns: Roo.data,
220                                 listeners : {
221                                     beforeload : function (_self, options)
222                                     {
223                                         var s = _this.grid.selModel.getSelected();
224                                         if (!s) { 
225                                             this.removeAll();
226                                             return false;
227                                         }
228                                         options.parms.curr_id = s.data.curr_id;
229                                     }
230                                 },
231                                 remoteSort : true,
232                                 sortInfo : { field : '', direction: 'ASC' },
233                                 proxy : {
234                                     xtype: 'HttpProxy',
235                                     xns: Roo.data,
236                                     method : 'GET',
237                                     url : baseURL + '/Roo/curr_rate.php'
238                                 },
239                                 reader : {
240                                     xtype: 'JsonReader',
241                                     xns: Roo.data,
242                                     totalProperty : 'total',
243                                     root : 'data',
244                                     id : 'id',
245                                     fields : [
246                                         {
247                                             'name': 'curr_rate_id',
248                                             'type': 'int'
249                                         },
250                                         {
251                                             'name': 'curr_id',
252                                             'type': 'int'
253                                         },
254                                         {
255                                             'name': 'curr_id',
256                                             'type': 'int'
257                                         },
258                                         {
259                                             'name': 'curr_rate',
260                                             'type': 'float'
261                                         },
262                                         {
263                                             'name': 'curr_effective',
264                                             'type': 'date',
265                                             'dateFormat': 'Y-m-d'
266                                         },
267                                         {
268                                             'name': 'curr_expires',
269                                             'type': 'date',
270                                             'dateFormat': 'Y-m-d'
271                                         }
272                                     ]
273                                 }
274                             },
275                             footer : {
276                                 xtype: 'PagingToolbar',
277                                 xns: Roo,
278                                 pageSize : 25,
279                                 displayInfo : true,
280                                 displayMsg : "Displaying curr_rate{0} - {1} of {2}",
281                                 emptyMsg : "No curr_rate found"
282                             },
283                             toolbar : {
284                                 xtype: 'Toolbar',
285                                 xns: Roo,
286                                 items : [
287                                     {
288                                         xtype: 'Fill',
289                                         xns: Roo.Toolbar
290                                     },
291                                     {
292                                         xtype: 'Button',
293                                         xns: Roo.Toolbar,
294                                         text : "Add",
295                                         cls : 'x-btn-text-icon',
296                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
297                                         listeners : {
298                                             click : function()
299                                             {
300                                                 if (!_this.dialog) return;
301                                                 _this.dialog.show( { id : 0 } , function() {
302                                                     _this.grid.footer.onClick('first');
303                                                }); 
304                                             }
305                                         }
306                                     }
307                                 ]
308                             },
309                             colModel : [
310                                 {
311                                     xtype: 'ColumnModel',
312                                     xns: Roo.grid,
313                                     header : 'Curr',
314                                     width : 75,
315                                     dataIndex : 'curr_id',
316                                     renderer : function(v) { return String.format('{0}', v); }
317                                 },
318                                 {
319                                     xtype: 'ColumnModel',
320                                     xns: Roo.grid,
321                                     header : 'Curr',
322                                     width : 75,
323                                     dataIndex : 'curr_id',
324                                     renderer : function(v) { return String.format('{0}', v); }
325                                 },
326                                 {
327                                     xtype: 'ColumnModel',
328                                     xns: Roo.grid,
329                                     header : 'Curr rate',
330                                     width : 75,
331                                     dataIndex : 'curr_rate',
332                                     renderer : function(v) { return String.format('{0}', v); }
333                                 },
334                                 {
335                                     xtype: 'ColumnModel',
336                                     xns: Roo.grid,
337                                     header : 'Curr effective',
338                                     width : 75,
339                                     dataIndex : 'curr_effective',
340                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
341                                 },
342                                 {
343                                     xtype: 'ColumnModel',
344                                     xns: Roo.grid,
345                                     header : 'Curr expires',
346                                     width : 75,
347                                     dataIndex : 'curr_expires',
348                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
349                                 }
350                             ]
351                         }
352                     }
353                 ],
354                 west : {
355                     xtype: 'LayoutRegion',
356                     xns: Roo,
357                     split : true,
358                     width : 300
359                 },
360                 center : {
361                     xtype: 'LayoutRegion',
362                     xns: Roo
363                 }
364             }
365         };
366     }
367 });