From: Alan Knowles Date: Tue, 8 Apr 2014 14:11:01 +0000 (+0800) Subject: roojs-calendar.js X-Git-Url: http://git.roojs.org/?p=roojs1;a=commitdiff_plain;h=df44d338efa80a0ee6e8f7e7f8c30ca5eb455142 roojs-calendar.js roojs-calendar-debug.js --- diff --git a/roojs-calendar-debug.js b/roojs-calendar-debug.js index 651f250b47..3efeda3930 100644 --- a/roojs-calendar-debug.js +++ b/roojs-calendar-debug.js @@ -1093,7 +1093,15 @@ 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 + }); @@ -1178,7 +1186,10 @@ Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, { if(this.tabIndex !== undefined){ this.el.dom.setAttribute('tabIndex', this.tabIndex); } + + this.initEvents(); + this.fireEvent('rendered'); }, diff --git a/roojs-calendar.js b/roojs-calendar.js index b4a6d202c5..fb1e08ad5e 100644 --- a/roojs-calendar.js +++ b/roojs-calendar.js @@ -22,7 +22,7 @@ Roo.each(this.cells.elements,function(c){c.rows=0;});Roo.each(this.calevents,fun this.renderEvents();}}); //Roo/CalendarPanel.js Roo.CalendarPanel=function(A){Roo.log("cal panel ctr");this.wrapper=Roo.DomHelper.append(document.body,{tag:"div",cls:"x-layout-grid-wrapper x-layout-inactive-content"},true);Roo.CalendarPanel.superclass.constructor.call(this,this.wrapper,A);Roo.log(this.el);if(this.toolbar){this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);}if(this.footer&&!this.footer.el&&this.footer.xtype){} -this.on('activate',function(){Roo.log('activate');this.render();},this);this.addEvents({'select':true,'monthchange':true,'evententer':true,'eventleave':true,'eventclick':true});};Roo.extend(Roo.CalendarPanel,Roo.ContentPanel,{getId:function(){return this.id;},destroy:function(){Roo.GridPanel.superclass.destroy.call(this);},render:function(){this.onRender(this.el,false)},onRender:function(ct,A){if(this.rendered){return;} +this.on('activate',function(){Roo.log('activate');this.render();},this);this.addEvents({'select':true,'monthchange':true,'evententer':true,'eventleave':true,'eventclick':true,'rendered':true});};Roo.extend(Roo.CalendarPanel,Roo.ContentPanel,{getId:function(){return this.id;},destroy:function(){Roo.GridPanel.superclass.destroy.call(this);},render:function(){this.onRender(this.el,false)},onRender:function(ct,A){if(this.rendered){return;} this.rendered=true;Roo.log("render calendar");var B=Roo.apply({},this.getAutoCreate());B.id=Roo.id();if(this.xattr&&typeof(this.xattr)=='object'){for(var i in this.xattr){B[i]=this.xattr[i];}}if(this.dataId){B.dataId=this.dataId;}if(this.cls){B.cls=(typeof(B.cls)=='undefined')?this.cls:B.cls+' '+this.cls;}if(this.style){B.style=this.style;}if(this.name){B.name=this.name;} this.el=ct.createChild(B,A);if(this.tabIndex!==undefined){this.el.dom.setAttribute('tabIndex',this.tabIndex);} -this.initEvents();},getAutoCreate:Roo.bootstrap.Calendar.prototype.getAutoCreate,initEvents:Roo.bootstrap.Calendar.prototype.initEvents});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];}); +this.initEvents();this.fireEvent('rendered');},getAutoCreate:Roo.bootstrap.Calendar.prototype.getAutoCreate,initEvents:Roo.bootstrap.Calendar.prototype.initEvents});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];});