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