Fix #7123 - getting abra ready to test
[Pman.Xtuple] / Pman.Tab.XtupleSales.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.XtupleSales = new Roo.XComponent({
6     part     :  ["Xtuple","Sales"],
7     order    : '002-Pman.Tab.XtupleSales',
8     region   : 'center',
9     parent   : 'Pman',
10     name     : "Pman.Tab.XtupleSales",
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             listeners : {
21                 activate : function () {
22                    
23                     
24                     if (typeof(Pman.Login) != 'undefined') {
25                          var db = baseURL.split('.php').shift().substr(-2,2)
26                     
27                         this.setTitle('Sales (' + Pman.Login.authUser.dbname +')');
28                         
29                     }
30                     
31                     (function() {
32                          var c= _this.layout.getRegion('center');
33                          c.showPanel(c.getActivePanel());
34                     
35                              }).defer(100);
36                 }
37             },
38             region : 'center',
39             title : "Sales",
40             layout : {
41                 xtype: 'BorderLayout',
42                 xns: Roo,
43                 items : [
44                     {
45                         xtype: 'GridPanel',
46                         xns: Roo,
47                         listeners : {
48                             activate : function() {
49                                 _this.panel = this;
50                                 if (_this.grid) {
51                                     _this.grid.footer.onClick('first');
52                                 }
53                             }
54                         },
55                         background : true,
56                         fitContainer : true,
57                         fitToframe : true,
58                         region : 'east',
59                         tableName : 'events',
60                         title : "events",
61                         grid : {
62                             xtype: 'Grid',
63                             xns: Roo.grid,
64                             listeners : {
65                                 render : function() 
66                                 {
67                                     _this.grid = this; 
68                                     //_this.dialog = Pman.Dialog.FILL_IN
69                                     if (_this.panel.active) {
70                                        this.footer.onClick('first');
71                                     }
72                                 },
73                                 rowdblclick : function (_self, rowIndex, e)
74                                 {
75                                     _this.dialog = Pman.Dialog.XtupleSalesOrder;
76                                     
77                                     data = this.getDataSource().getAt(rowIndex).data;
78                                     
79                                     _this.dialog.show( 
80                                         { cohead_id : data.on_id_cohead_id } , 
81                                         function() {
82                                             _this.grid.footer.onClick('first');
83                                             Pman.Tab.XtupleSalesOrder.grid.footer.onClick('refresh');
84                                             
85                                         }
86                                     ); 
87                                 }
88                             },
89                             autoExpandColumn : 'on_id',
90                             loadMask : true,
91                             dataSource : {
92                                 xtype: 'Store',
93                                 xns: Roo.data,
94                                 listeners : {
95                                     beforeload : function (_self, options)
96                                     {
97                                         options.params._join = 'cohead';
98                                         options.params.on_table = 'cohead';
99                                         options.params._join_cols   = 'cohead_number,cohead_id';
100                                         options.params.sort = '';
101                                         options.params.person_id = Pman.Login.authUser.id;
102                                         
103                                          /// on_table=cohead
104                                             //   &_join=cohead
105                                             //   &_join_cols=cohead_number
106                                             //    &_columns=on_id_cohead_number,event_when << this is ignored at present.
107                                             // max(event_when) is not supported... by any query yet..
108                                             
109                                     }
110                                 },
111                                 remoteSort : true,
112                                 proxy : {
113                                     xtype: 'HttpProxy',
114                                     xns: Roo.data,
115                                     method : 'GET',
116                                     url : baseURL + '/Roo/events.php'
117                                 },
118                                 reader : {
119                                     xtype: 'JsonReader',
120                                     xns: Roo.data,
121                                     totalProperty : 'total',
122                                     root : 'data',
123                                     id : 'id',
124                                     fields : [
125                                         {
126                                             'name': 'on_id',
127                                             'type': 'int'
128                                         }
129                                     ]
130                                 }
131                             },
132                             footer : {
133                                 xtype: 'PagingToolbar',
134                                 xns: Roo,
135                                 displayInfo : true,
136                                 displayMsg : ".",
137                                 emptyMsg : ".",
138                                 pageSize : 25
139                             },
140                             colModel : [
141                                 {
142                                     xtype: 'ColumnModel',
143                                     xns: Roo.grid,
144                                     dataIndex : 'on_id_cohead_number',
145                                     header : 'on',
146                                     width : 75,
147                                     renderer : function(v) { return String.format('{0}', v); }
148                                 }
149                             ]
150                         }
151                     }
152                 ],
153                 east : {
154                     xtype: 'LayoutRegion',
155                     xns: Roo,
156                     title : "last edited",
157                     collapsible : true,
158                     width : '150',
159                     split : true
160                 },
161                 center : {
162                     xtype: 'LayoutRegion',
163                     xns: Roo,
164                     tabPosition : 'top'
165                 }
166             }
167         };
168     }
169 });