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: 'Button',
118                                         xns: Roo.Toolbar,
119                                         text : "Add",
120                                         cls : 'x-btn-text-icon',
121                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
122                                         listeners : {
123                                             click : function()
124                                             {
125                                                 if (!_this.dialog) return;
126                                                 _this.dialog.show( { id : 0 } , function() {
127                                                     _this.grid.footer.onClick('first');
128                                                }); 
129                                             }
130                                         }
131                                     },
132                                     {
133                                         xtype: 'Button',
134                                         xns: Roo.Toolbar,
135                                         text : "Edit",
136                                         cls : 'x-btn-text-icon',
137                                         icon : Roo.rootURL + 'images/default/tree/leaf.gif',
138                                         listeners : {
139                                             click : function()
140                                             {
141                                                 var s = _this.grid.getSelectionModel().getSelections();
142                                                 if (!s.length || (s.length > 1))  {
143                                                     Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
144                                                     return;
145                                                 }
146                                                 if (!_this.dialog) return;
147                                                 _this.dialog.show(s[0].data, function() {
148                                                     _this.grid.footer.onClick('first');
149                                                 }); 
150                                                 
151                                             }
152                                         }
153                                     },
154                                     {
155                                         xtype: 'Button',
156                                         xns: Roo.Toolbar,
157                                         text : "Delete",
158                                         cls : 'x-btn-text-icon',
159                                         icon : rootURL + '/Pman/templates/images/trash.gif',
160                                         listeners : {
161                                             click : function()
162                                             {
163                                                  Pman.genericDelete(_this, 'curr_symbol'); 
164                                             }
165                                         }
166                                     }
167                                 ]
168                             },
169                             colModel : [
170                                 {
171                                     xtype: 'ColumnModel',
172                                     xns: Roo.grid,
173                                     header : 'Curr',
174                                     width : 75,
175                                     dataIndex : 'curr_id',
176                                     renderer : function(v) { return String.format('{0}', v); }
177                                 },
178                                 {
179                                     xtype: 'ColumnModel',
180                                     xns: Roo.grid,
181                                     header : 'Curr base',
182                                     width : 75,
183                                     dataIndex : 'curr_base',
184                                     renderer : function(v) { return String.format('{0}', v); }
185                                 },
186                                 {
187                                     xtype: 'ColumnModel',
188                                     xns: Roo.grid,
189                                     header : 'Curr name',
190                                     width : 200,
191                                     dataIndex : 'curr_name',
192                                     renderer : function(v) { return String.format('{0}', v); }
193                                 },
194                                 {
195                                     xtype: 'ColumnModel',
196                                     xns: Roo.grid,
197                                     header : 'Curr symbol',
198                                     width : 200,
199                                     dataIndex : 'curr_symbol',
200                                     renderer : function(v) { return String.format('{0}', v); }
201                                 },
202                                 {
203                                     xtype: 'ColumnModel',
204                                     xns: Roo.grid,
205                                     header : 'Curr abbr',
206                                     width : 200,
207                                     dataIndex : 'curr_abbr',
208                                     renderer : function(v) { return String.format('{0}', v); }
209                                 }
210                             ]
211                         }
212                     },
213                     {
214                         xtype: 'GridPanel',
215                         xns: Roo,
216                         listeners : {
217                             activate : function() {
218                                 _this.rpanel = this;
219                                 if (_this.rgrid) {
220                                     _this.rgrid.footer.onClick('first');
221                                 }
222                             }
223                         },
224                         background : false,
225                         fitContainer : true,
226                         fitToframe : true,
227                         region : 'center',
228                         tableName : 'curr_rate',
229                         title : "curr_rate",
230                         grid : {
231                             xtype: 'Grid',
232                             xns: Roo.grid,
233                             listeners : {
234                                 render : function() 
235                                 {
236                                     _this.rgrid = this; 
237                                     //_this.dialog = Pman.Dialog.FILL_IN
238                                     if (_this.rpanel.active) {
239                                        this.footer.onClick('first');
240                                     }
241                                 },
242                                 rowdblclick : function (_self, rowIndex, e)
243                                 {
244                                     if (!_this.dialog) return;
245                                     _this.dialog.show( this.getDataSource().getAt(rowIndex).data, function() {
246                                         _this.grid.footer.onClick('first');
247                                     }); 
248                                 }
249                             },
250                             autoExpandColumn : '',
251                             loadMask : true,
252                             dataSource : {
253                                 xtype: 'Store',
254                                 xns: Roo.data,
255                                 remoteSort : true,
256                                 sortInfo : { field : '', direction: 'ASC' },
257                                 proxy : {
258                                     xtype: 'HttpProxy',
259                                     xns: Roo.data,
260                                     method : 'GET',
261                                     url : baseURL + '/Roo/curr_rate.php'
262                                 },
263                                 reader : {
264                                     xtype: 'JsonReader',
265                                     xns: Roo.data,
266                                     totalProperty : 'total',
267                                     root : 'data',
268                                     id : 'id',
269                                     fields : [
270                                         {
271                                             'name': 'curr_rate_id',
272                                             'type': 'int'
273                                         },
274                                         {
275                                             'name': 'curr_id',
276                                             'type': 'int'
277                                         },
278                                         {
279                                             'name': 'curr_id',
280                                             'type': 'int'
281                                         },
282                                         {
283                                             'name': 'curr_rate',
284                                             'type': 'float'
285                                         },
286                                         {
287                                             'name': 'curr_effective',
288                                             'type': 'date',
289                                             'dateFormat': 'Y-m-d'
290                                         },
291                                         {
292                                             'name': 'curr_expires',
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 curr_rate{0} - {1} of {2}",
305                                 emptyMsg : "No curr_rate found"
306                             },
307                             toolbar : {
308                                 xtype: 'Toolbar',
309                                 xns: Roo,
310                                 items : [
311                                     {
312                                         xtype: 'Button',
313                                         xns: Roo.Toolbar,
314                                         text : "Add",
315                                         cls : 'x-btn-text-icon',
316                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
317                                         listeners : {
318                                             click : function()
319                                             {
320                                                 if (!_this.dialog) return;
321                                                 _this.dialog.show( { id : 0 } , function() {
322                                                     _this.grid.footer.onClick('first');
323                                                }); 
324                                             }
325                                         }
326                                     }
327                                 ]
328                             },
329                             colModel : [
330                                 {
331                                     xtype: 'ColumnModel',
332                                     xns: Roo.grid,
333                                     header : 'Curr rate',
334                                     width : 75,
335                                     dataIndex : 'curr_rate_id',
336                                     renderer : function(v) { return String.format('{0}', v); }
337                                 },
338                                 {
339                                     xtype: 'ColumnModel',
340                                     xns: Roo.grid,
341                                     header : 'Curr',
342                                     width : 75,
343                                     dataIndex : 'curr_id',
344                                     renderer : function(v) { return String.format('{0}', v); }
345                                 },
346                                 {
347                                     xtype: 'ColumnModel',
348                                     xns: Roo.grid,
349                                     header : 'Curr',
350                                     width : 75,
351                                     dataIndex : 'curr_id',
352                                     renderer : function(v) { return String.format('{0}', v); }
353                                 },
354                                 {
355                                     xtype: 'ColumnModel',
356                                     xns: Roo.grid,
357                                     header : 'Curr rate',
358                                     width : 75,
359                                     dataIndex : 'curr_rate',
360                                     renderer : function(v) { return String.format('{0}', v); }
361                                 },
362                                 {
363                                     xtype: 'ColumnModel',
364                                     xns: Roo.grid,
365                                     header : 'Curr effective',
366                                     width : 75,
367                                     dataIndex : 'curr_effective',
368                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
369                                 },
370                                 {
371                                     xtype: 'ColumnModel',
372                                     xns: Roo.grid,
373                                     header : 'Curr expires',
374                                     width : 75,
375                                     dataIndex : 'curr_expires',
376                                     renderer : function(v) { return String.format('{0}', v ? v.format('d/M/Y') : ''); }
377                                 }
378                             ]
379                         }
380                     }
381                 ],
382                 west : {
383                     xtype: 'LayoutRegion',
384                     xns: Roo,
385                     width : 200
386                 },
387                 center : {
388                     xtype: 'LayoutRegion',
389                     xns: Roo
390                 }
391             }
392         };
393     }
394 });