allow string based values for comboboxarray
[roojs1] / Roo / CalendarPanel.js
index 8f3491b..1755aa4 100644 (file)
@@ -22,7 +22,7 @@ Roo.CalendarPanel = function(config){
   
     this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
         {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
-    
+        
     //this.wrapper.dom.appendChild(grid.getGridEl().dom);
     
     Roo.CalendarPanel.superclass.constructor.call(this, this.wrapper, config);
@@ -40,16 +40,16 @@ Roo.CalendarPanel = function(config){
         //this.footer = Roo.factory(this.footer, Roo);
         
     }
-//    this.view = new Roo.calendar.View(Roo.apply({
-//        skipNavHeader : true,
-//        skipMonthHeader : true
-//        
-//    },config));
-//    
+    this.view = new Roo.calendar.View(Roo.apply({
+        skipNavHeader : true,
+        skipMonthHeader : false
+        
+    },config));
+    
      
     this.on('activate', function()
     {
-        Roo.log('CalendarPanel.js activate');
+        Roo.log('activate');
          
         //console.log('render tree');
         this.render();
@@ -101,7 +101,7 @@ Roo.CalendarPanel = function(config){
         
         
     });
-//    this.relayEvents(this.view, ["select","monthchange","evententer","eventleave","rendered"]);
+    this.relayEvents(this.view, ["select","monthchange","evententer","eventleave","rendered"]);
 
     //this.grid = grid;
     //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
@@ -124,47 +124,46 @@ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
         }
         this.rendered = true;
         
-        Roo.log("CalendarPanel.js render calendar");
+        Roo.log("render calendar");
         
         
         //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
         
-//        
-//        var cfg = Roo.apply({},  this.view.getAutoCreate());
-//        cfg.id = Roo.id();
-//        
-//        // fill in the extra attributes 
-//        if (this.xattr && typeof(this.xattr) =='object') {
-//            for (var i in this.xattr) {
-//                cfg[i] = this.xattr[i];
-//            }
-//        }
-//        
-//        if(this.dataId){
-//            cfg.dataId = this.dataId;
-//        }
-//        
-//        if (this.cls) {
-//            cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
-//        }
-//        
-//        if (this.style) { // fixme needs to support more complex style data.
-//            cfg.style = this.style;
-//        }
-//        
-//        if(this.name){
-//            cfg.name = this.name;
-//        }
-//        
-////        this.view.el =  ct.createChild(cfg, position);
-//        Roo.log('this.view');
-//        Roo.log(this.view);
-//        //if(this.tabIndex !== undefined){
-//        //    this.el.dom.setAttribute('tabIndex', this.tabIndex);
-//        //}
-//        
-//        
-//        this.view.initEvents();
+        
+        var cfg = Roo.apply({},  this.view.getAutoCreate());
+        cfg.id = Roo.id();
+        
+        // fill in the extra attributes 
+        if (this.xattr && typeof(this.xattr) =='object') {
+            for (var i in this.xattr) {
+                cfg[i] = this.xattr[i];
+            }
+        }
+        
+        if(this.dataId){
+            cfg.dataId = this.dataId;
+        }
+        
+        if (this.cls) {
+            cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
+        }
+        
+        if (this.style) { // fixme needs to support more complex style data.
+            cfg.style = this.style;
+        }
+        
+        if(this.name){
+            cfg.name = this.name;
+        }
+        
+        this.view.el =  ct.createChild(cfg, position);
+        
+        //if(this.tabIndex !== undefined){
+        //    this.el.dom.setAttribute('tabIndex', this.tabIndex);
+        //}
+        
+        
+        this.view.initEvents();
         this.fireEvent('rendered');
     }