X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Roo%2FCalendarPanel.js;h=1755aa4a64eb291824991c15be6d5cc1660ae0b6;hb=refs%2Fheads%2Fwip_leon_T7094_logo_image_upload_in_boilerplate;hp=051dee9201b07ba09439dc0c53b7b68e7c5aee5b;hpb=02e28bc8d0ce04ddd9e5c41323d93758fd5e5d29;p=roojs1 diff --git a/Roo/CalendarPanel.js b/Roo/CalendarPanel.js index 051dee9201..1755aa4a64 100644 --- a/Roo/CalendarPanel.js +++ b/Roo/CalendarPanel.js @@ -40,7 +40,13 @@ Roo.CalendarPanel = function(config){ //this.footer = Roo.factory(this.footer, Roo); } + this.view = new Roo.calendar.View(Roo.apply({ + skipNavHeader : true, + skipMonthHeader : false + + },config)); + this.on('activate', function() { Roo.log('activate'); @@ -84,46 +90,30 @@ Roo.CalendarPanel = function(config){ * @param {Calendar} this * @param {event} */ - 'eventclick': true + 'eventclick': true, + /** + * @event rendered + * Fires when the grid is rendered + * @param {Calendar} this + + */ + 'rendered': true + }); - + this.relayEvents(this.view, ["select","monthchange","evententer","eventleave","rendered"]); + //this.grid = grid; //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel"); }; -Roo.apply(Roo.CalendarPanel, Roo.boostrap.Calendar); Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, { - 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) }, @@ -136,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 @@ -165,18 +156,20 @@ 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); - } - this.initEvents(); - }/*, + //if(this.tabIndex !== undefined){ + // this.el.dom.setAttribute('tabIndex', this.tabIndex); + //} + + + this.view.initEvents(); + this.fireEvent('rendered'); + } - getAutoCreate : Roo.bootstrap.Calendar.prototype.getAutoCreate, - initEvents : Roo.bootstrap.Calendar.prototype.initEvents - */ }); + +