Pman.Tab.MTrackMerger.js
[Pman.MTrack] / Pman.Tab.MTrackMerger.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5
6
7 // register the module first
8 Pman.on('beforeload', function()
9 {
10     Pman.register({
11         modKey : '400-Pman.Tab.MTrackMerger',
12         module : Pman.Tab.MTrackMerger,
13         region : 'center',
14         parent : Pman.Tab.MTrack,
15         name : "Pman.Tab.MTrackMerger",
16         disabled : false, 
17         permname: '' 
18     });
19 });
20
21 Pman.Tab.MTrackMerger = new Roo.util.Observable({
22
23     panel : false,
24     disabled : false,
25     parentLayout:  false,
26
27     add : function(parentLayout, region)
28     {
29
30         var _this = this;
31         this.parentLayout = parentLayout;
32
33         this.panel = parentLayout.addxtype({
34             xtype: 'NestedLayoutPanel',
35             xns: Roo,
36             region : 'center',
37             title : "Merger",
38             layout : {
39                 xtype: 'BorderLayout',
40                 xns: Roo,
41                 items : [
42                     {
43                         xtype: 'TreePanel',
44                         xns: Roo,
45                         autoScroll : true,
46                         fitToFrame : true,
47                         region : 'west',
48                         tree : {
49                             xtype: 'TreePanel',
50                             xns: Roo.tree,
51                             loader : {
52                                 xtype: 'TreeLoader',
53                                 xns: Roo.tree,
54                                 baseParams : '{ _tree : 1 }',
55                                 requestMethod : 'GET',
56                                 root : 'data',
57                                 dataUrl : rootURL + '/MTrack/Merger'
58                             },
59                             root : {
60                                 xtype: 'TreeNode',
61                                 xns: Roo.tree,
62                                 text : "All Changes"
63                             }
64                         }
65                     },
66                     {
67                         xtype: 'GridPanel',
68                         xns: Roo,
69                         title : "core_enum",
70                         fitToframe : true,
71                         fitContainer : true,
72                         tableName : 'core_enum',
73                         background : true,
74                         region : 'center',
75                         listeners : {
76                             activate : function() {
77                                 _this.panel = this;
78                                 if (_this.grid) {
79                                     _this.grid.footer.onClick('first');
80                                 }
81                             }
82                         },
83                         grid : {
84                             xtype: 'Grid',
85                             xns: Roo.grid,
86                             autoExpandColumn : 'etype',
87                             loadMask : true,
88                             listeners : {
89                                 render : function() 
90                                 {
91                                     _this.grid = this; 
92                                     //_this.dialog = Pman.Dialog.FILL_IN
93                                     if (_this.panel.active) {
94                                        this.footer.onClick('first');
95                                     }
96                                 },
97                                 rowdblclick : function (_self, rowIndex, e)
98                                 {
99                                     if (!_this.dialog) return;
100                                     _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {
101                                         _this.grid.footer.onClick('first');
102                                     }); 
103                                 }
104                             },
105                             dataSource : {
106                                 xtype: 'Store',
107                                 xns: Roo.data,
108                                 remoteSort : true,
109                                 sortInfo : { field : 'etype', direction: 'ASC' },
110                                 proxy : {
111                                     xtype: 'HttpProxy',
112                                     xns: Roo.data,
113                                     method : 'GET',
114                                     url : baseURL + '/Roo/core_enum.php'
115                                 },
116                                 reader : {
117                                     xtype: 'JsonReader',
118                                     xns: Roo.data,
119                                     totalProperty : 'total',
120                                     root : 'data',
121                                     id : 'id',
122                                     fields : [
123                                         {
124                                             'name': 'id',
125                                             'type': 'int'
126                                         },
127                                         {
128                                             'name': 'etype',
129                                             'type': 'string'
130                                         },
131                                         {
132                                             'name': 'name',
133                                             'type': 'string'
134                                         },
135                                         {
136                                             'name': 'active',
137                                             'type': 'int'
138                                         },
139                                         {
140                                             'name': 'seqid',
141                                             'type': 'int'
142                                         }
143                                     ]
144                                 }
145                             },
146                             footer : {
147                                 xtype: 'PagingToolbar',
148                                 xns: Roo,
149                                 pageSize : 25,
150                                 displayInfo : true,
151                                 displayMsg : "Displaying core_enum{0} - {1} of {2}",
152                                 emptyMsg : "No core_enum found"
153                             },
154                             toolbar : {
155                                 xtype: 'Toolbar',
156                                 xns: Roo,
157                                 items : [
158                                     {
159                                         xtype: 'Button',
160                                         xns: Roo.Toolbar,
161                                         listeners : {
162                                             click : function()
163                                             {
164                                                
165                                             }
166                                         },
167                                         cls : 'x-btn-text-icon',
168                                         text : "Create Commit",
169                                         icon : Roo.rootURL + 'images/default/dd/drop-add.gif'
170                                     },
171                                     {
172                                         xtype: 'Button',
173                                         xns: Roo.Toolbar,
174                                         text : "Edit",
175                                         cls : 'x-btn-text-icon',
176                                         icon : Roo.rootURL + 'images/default/tree/leaf.gif',
177                                         listeners : {
178                                             click : function()
179                                             {
180                                                 var s = _this.grid.getSelectionModel().getSelections();
181                                                 if (!s.length || (s.length > 1))  {
182                                                     Roo.MessageBox.alert("Error", s.length ? "Select only one Row" : "Select a Row");
183                                                     return;
184                                                 }
185                                                 if (!_this.dialog) return;
186                                                 _this.dialog.show(s[0].data, function() {
187                                                     _this.grid.footer.onClick('first');
188                                                 }); 
189                                                 
190                                             }
191                                         }
192                                     },
193                                     {
194                                         xtype: 'Button',
195                                         xns: Roo.Toolbar,
196                                         text : "Delete",
197                                         cls : 'x-btn-text-icon',
198                                         icon : rootURL + '/Pman/templates/images/trash.gif',
199                                         listeners : {
200                                             click : function()
201                                             {
202                                                  Pman.genericDelete(_this, 'core_enum'); 
203                                             }
204                                         }
205                                     }
206                                 ]
207                             },
208                             colModel : [
209                                 {
210                                     xtype: 'ColumnModel',
211                                     xns: Roo.grid,
212                                     dataIndex : 'file',
213                                     header : 'File',
214                                     width : 200,
215                                     renderer : function(v) { return String.format('{0}', v); }
216                                 },
217                                 {
218                                     xtype: 'ColumnModel',
219                                     xns: Roo.grid,
220                                     header : 'Name',
221                                     width : 200,
222                                     dataIndex : 'name',
223                                     renderer : function(v) { return String.format('{0}', v); }
224                                 },
225                                 {
226                                     xtype: 'ColumnModel',
227                                     xns: Roo.grid,
228                                     header : 'Active',
229                                     width : 75,
230                                     dataIndex : 'active',
231                                     renderer : function(v) { return String.format('{0}', v); }
232                                 },
233                                 {
234                                     xtype: 'ColumnModel',
235                                     xns: Roo.grid,
236                                     header : 'Seqid',
237                                     width : 75,
238                                     dataIndex : 'seqid',
239                                     renderer : function(v) { return String.format('{0}', v); }
240                                 }
241                             ]
242                         }
243                     }
244                 ],
245                 west : {
246                     xtype: 'LayoutRegion',
247                     xns: Roo,
248                     width : 200
249                 },
250                 center : {
251                     xtype: 'LayoutRegion',
252                     xns: Roo
253                 },
254                 south : {
255                     xtype: 'LayoutRegion',
256                     xns: Roo
257                 }
258             }
259         });
260         this.layout = this.panel.layout;
261
262     }
263 });