X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FCalendarPanel.js;h=1755aa4a64eb291824991c15be6d5cc1660ae0b6;hb=0b69a11b1055a6d3a3fd0719bdd58b5a235de0e4;hp=23ffa34b0d593631fa4e24eb0ab9224d71ae703f;hpb=d8518aafd171706fb2da43a2b114998aa549571e;p=roojs1 diff --git a/Roo/CalendarPanel.js b/Roo/CalendarPanel.js index 23ffa34b0d..1755aa4a64 100644 --- a/Roo/CalendarPanel.js +++ b/Roo/CalendarPanel.js @@ -40,7 +40,11 @@ Roo.CalendarPanel = function(config){ //this.footer = Roo.factory(this.footer, Roo); } - this.view = new Roo.calendar.View(config); + this.view = new Roo.calendar.View(Roo.apply({ + skipNavHeader : true, + skipMonthHeader : false + + },config)); this.on('activate', function() @@ -106,37 +110,10 @@ Roo.CalendarPanel = function(config){ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, { - startDay : 0, - - getId : function(){ - return this.id; - }, - /* - setSize : function(width, height){ - if(!this.ignoreResize(width, height)){ - var grid = this.grid; - var size = this.adjustForComponents(width, height); - grid.getGridEl().setSize(size.width, size.height); - grid.autoSize(); - } - }, - - beforeSlide : function(){ - this.grid.getView().scroller.clip(); - }, - - afterSlide : function(){ - this.grid.getView().scroller.unclip(); - }, - */ - destroy : function(){ - // this.grid.destroy(); - // delete this.grid; - Roo.GridPanel.superclass.destroy.call(this); - - }, + render : function() { + var ct = this.el.appendChild(document.createElement("div")); this.onRender(this.el, false) }, @@ -149,10 +126,11 @@ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, { Roo.log("render calendar"); + //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position); - var cfg = Roo.apply({}, this.getAutoCreate()); + var cfg = Roo.apply({}, this.view.getAutoCreate()); cfg.id = Roo.id(); // fill in the extra attributes @@ -178,14 +156,14 @@ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, { cfg.name = this.name; } - this.el = ct.createChild(cfg, position); + this.view.el = ct.createChild(cfg, position); - if(this.tabIndex !== undefined){ - this.el.dom.setAttribute('tabIndex', this.tabIndex); - } + //if(this.tabIndex !== undefined){ + // this.el.dom.setAttribute('tabIndex', this.tabIndex); + //} - this.initEvents(); + this.view.initEvents(); this.fireEvent('rendered'); } @@ -194,33 +172,4 @@ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, { }); - - -Roo.each([ - 'getAutoCreate', - 'initEvents', - 'resize', - 'showPrevMonth', - 'showToday', - 'showNextMonth', - 'showPrevYear', - 'showNextYear', - 'update', - 'findCell', - 'findCells', - 'findBestRow', - 'addItem', - 'clearEvents', - 'renderEvents', - 'onEventEnter', - 'onEventLeave', - 'onEventClick', - 'onMonthChange', - 'onLoad' - - -], function(p) { - Roo.log('add' + p); - Roo.CalendarPanel.prototype[p] = Roo.bootstrap.Calendar.prototype[p]; -});