examples/layout/calendar.js
authorEdward <edward@roojs.com>
Wed, 9 Apr 2014 09:01:57 +0000 (17:01 +0800)
committerEdward <edward@roojs.com>
Wed, 9 Apr 2014 09:01:57 +0000 (17:01 +0800)
examples/layout/calendar.js

index 8567470..a85756e 100644 (file)
@@ -15,49 +15,73 @@ calendarpanel = new Roo.XComponent({
         var _this = this;
         var MODULE = this;
         return {
-            xtype: 'CalendarPanel',
+            xtype: 'NestedLayoutPanel',
             xns: Roo,
-            listeners : {
-                activate : function (_self)
-                {
-                    Roo.log('activate');
-                },
-                render : function (_self)
-                {
-                    Roo.log('render');
+            region : 'center',
+            layout : {
+                xtype: 'BorderLayout',
+                region : 'center',
+                xns: Roo,
+                items : [
+                    {
+                        xtype: 'CalendarPanel',
+                        xns: Roo,
+                        region : 'center',
+                        listeners : {
+                            activate : function (_self)
+                            {
+                                Roo.log('activate');
+                            },
+                            render : function (_self)
+                            {
+                                Roo.log('render');
+                            }
+                        },
+                          store : {
+                                xtype: 'Store',
+                                xns: Roo.data,
+                                listeners : {
+                                    beforeload : function (_self, o){
+                                        o.params = o.params || {};
+                                        var d = new Date().format('Y-m-d');
+                                        if(_this.cal){
+                                            d = typeof(_this.cal.activeDate) == 'string' ? _this.cal.activeDate : _this.cal.activeDate.format("Y-m-d");
+                                        }
+                                        o.params._activeDate = d
+                                    }
+                                },
+                                remoteSort : true,
+                                sortInfo : { direction : 'ASC', field: 'start_dt' },
+                                proxy : {
+                                    xtype: 'HttpProxy',
+                                    xns: Roo.data,
+                                    method : 'GET',
+                                    url : 'http://roojs.com/admin.php/Roo/mtrack_ticket?_dc=1396967515369&_future_schedule=1&query%5Bviewtype%5D=active&limit=999&sort=summary&dir=ASC'
+                                },
+                                reader : {
+                                    xtype: 'JsonReader',
+                                    xns: Roo.data,
+                                    id : 'id',
+                                    root : 'data',
+                                    totalProperty : 'total',
+                                    fields : [{"name":"id","type":"int"},{"name":"title","type":"string"}]
+                                }
+                            }
+                    }
+                         
+                ],
+                center : {
+                    xtype: 'LayoutRegion',
+                    xns: Roo
                 }
             },
-            store : {
-                xtype: 'Store',
-                xns: Roo.data,
-                listeners : {
-                    beforeload : function (_self, o){
-                        o.params = o.params || {};
-                        var d = new Date().format('Y-m-d');
-                        if(_this.cal){
-                            d = typeof(_this.cal.activeDate) == 'string' ? _this.cal.activeDate : _this.cal.activeDate.format("Y-m-d");
-                        }
-                        o.params._activeDate = d
-                    }
-                },
-                remoteSort : true,
-                sortInfo : { direction : 'ASC', field: 'start_dt' },
-                proxy : {
-                    xtype: 'HttpProxy',
-                    xns: Roo.data,
-                    method : 'GET',
-                    url : 'http://roojs.com/admin.php/Roo/mtrack_ticket?_dc=1396967515369&_future_schedule=1&query%5Bviewtype%5D=active&limit=999&sort=summary&dir=ASC'
-                },
-                reader : {
-                    xtype: 'JsonReader',
-                    xns: Roo.data,
-                    id : 'id',
-                    root : 'data',
-                    totalProperty : 'total',
-                    fields : [{"name":"id","type":"int"},{"name":"title","type":"string"}]
+            listeners : {
+                'activate' : function() {
+                    _this.nest = this;
+                    Roo.log('nested activate');
+                    this.layout.getRegion('center').showPanel(0);;
                 }
             }
-        }
-            
+        };
     }
 });