MTrackWeb/templates/images/MTrackWeb/MTrackWeb.Layout.js
[web.mtrack] / MTrackWeb / templates / images / MTrackWeb / MTrackWeb.Layout.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 MTrackWeb.Layout = new Roo.XComponent({
6     order    : '001-MTrackWeb.Layout',
7     region   : 'center',
8     parent   : false,
9     name     : "unnamed module",
10     disabled : false, 
11     tree : function()
12     {
13         var _this = this;
14         var MODULE = this;
15         return {
16             xtype: 'NestedLayoutPanel',
17             xns: Roo,
18             layout : {
19                 xtype: 'BorderLayout',
20                 xns: Roo,
21                 items : [
22                     {
23                         xtype: 'ContentPanel',
24                         xns: Roo,
25                         region : 'north',
26                         content : '<div class="banner-username"></div>' + 
27                                 '<div id="banner">' +
28                                     '<a href="' + rootURL + '"><img style="float: left;margin-right: 10px;" src="' +
29                                         rootURL + '/Roojscom/templates/images/roojsorg_logo-55.png" width="150" height="55"></a>' +
30                                     '<div class="banner-title">Project Tracker</div>'+
31                                 '</div>'
32                     },
33                     {
34                         xtype: 'ContentPanel',
35                         xns: Roo,
36                         region : 'center',
37                         title : "test"
38                     }
39                 ],
40                 north : {
41                     xtype: 'LayoutRegion',
42                     xns: Roo,
43                     height : 52,
44                     titlebar : false
45                 },
46                 center : {
47                     xtype: 'LayoutRegion',
48                     xns: Roo,
49                     alwaysShowTabs : true,
50                     tabPosition : 'top',
51                     toolbar : {
52                         xtype: 'Toolbar',
53                         xns: Roo,
54                         items : [
55                             {
56                                 xtype: 'Fill',
57                                 xns: Roo.Toolbar
58                             },
59                             {
60                                 xtype: 'TextItem',
61                                 xns: Roo.Toolbar,
62                                 text : "Project:"
63                             },
64                             {
65                                 xtype: 'ComboBox',
66                                 xns: Roo.form,
67                                 listeners : {
68                                     beforeselect : function (combo, record, index)
69                                     {
70                                       // this should post to the system, - to register active Project..
71                                                             // it's not really needed in new version... but done for compat.
72                                                             // at present..
73                                             Roo.Ajax.request( {
74                                                 method: 'POST',
75                                                 url : baseURL + '/Projects/' + rec.data.id,
76                                                 success : function (data) {
77                                                     // then, it should refresh the current active tab..
78                                                     MTrack.ajaxLoad( MTrack.currentURL);
79                                                 }
80                                             }); 
81                                         
82                                     },
83                                     render : function (_self)
84                                     {
85                                         
86                                         if (MTrack) {
87                                             MTrack.projectCombo = _self;
88                                         }
89                                         // set the default value to our current project..
90                                         this.setFromData({
91                                             id : project_id,
92                                             name : project_name
93                                         });
94                                     }
95                                 },
96                                 allowBlank : false,
97                                 alwaysQuery : true,
98                                 displayField : 'name',
99                                 editable : false,
100                                 emptyText : "Select Project",
101                                 forceSelection : true,
102                                 listWidth : 400,
103                                 loadingText : "Searching...",
104                                 pageSize : 40,
105                                 qtip : "Select Project",
106                                 selectOnFocus : true,
107                                 tpl : '<div class="x-grid-cell-text x-btn button"><b>{code}</b> {name} </div>',
108                                 triggerAction : 'all',
109                                 typeAhead : true,
110                                 valueField : 'id',
111                                 width : 200,
112                                 store : {
113                                     xtype: 'Store',
114                                     xns: Roo.data,
115                                     listeners : {
116                                         beforeload : function (_self, o){
117                                             o.params = o.params || {};
118                                             // set more here
119                                         }
120                                     },
121                                     remoteSort : true,
122                                     sortInfo : { direction : 'ASC', field: 'name' },
123                                     proxy : {
124                                         xtype: 'HttpProxy',
125                                         xns: Roo.data,
126                                         method : 'GET',
127                                         url : baseURL + '/Projects.php'
128                                     },
129                                     reader : {
130                                         xtype: 'JsonReader',
131                                         xns: Roo.data,
132                                         id : 'id',
133                                         root : 'data',
134                                         totalProperty : 'total',
135                                         fields : [{"name":"id","type":"int"},"name","code"]
136                                     }
137                                 }
138                             },
139                             {
140                                 xtype: 'TextField',
141                                 xns: Roo.form,
142                                 listeners : {
143                                     specialkey : function (_self, e)
144                                     {
145                                        if (e.getKey() == 13) {
146                                             // search!
147                                        }
148                                     }
149                                 },
150                                 emptyText : "Search (to be done..)",
151                                 width : 100
152                             },
153                             {
154                                 xtype: 'Button',
155                                 xns: Roo.Toolbar,
156                                 text : "test"
157                             }
158                         ]
159                     }
160                 },
161                 south : {
162                     xtype: 'LayoutRegion',
163                     xns: Roo,
164                     height : 30,
165                     titlebar : false
166                 }
167             }
168         };
169     }
170 });