4 * based on jquery fullcalendar
11 * @extends Roo.Component
12 * Bootstrap Calendar class
15 * Create a new Container
16 * @param {Object} config The config object
19 Roo.CalendarPanel = function(config){
21 Roo.log("cal panel ctr");
23 this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
24 {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
26 //this.wrapper.dom.appendChild(grid.getGridEl().dom);
28 Roo.CalendarPanel.superclass.constructor.call(this, this.wrapper, config);
33 this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
35 // xtype created footer. - not sure if will work as we normally have to render first..
36 if (this.footer && !this.footer.el && this.footer.xtype) {
38 //this.footer.container = this.grid.getView().getFooterPanel(true);
39 //this.footer.dataSource = this.grid.dataSource;
40 //this.footer = Roo.factory(this.footer, Roo);
44 this.on('activate', function()
48 //console.log('render tree');
55 * Fires when a date is selected
56 * @param {DatePicker} this
57 * @param {Date} date The selected date
62 * Fires when the displayed month changes
63 * @param {DatePicker} this
64 * @param {Date} date The selected month
69 * Fires when mouse over an event
70 * @param {Calendar} this
71 * @param {event} Event
76 * Fires when the mouse leaves an
77 * @param {Calendar} this
83 * Fires when the mouse click an
84 * @param {Calendar} this
92 //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
121 Roo.CalendarPanel.prototype[p] = Roo.boostrap.Calendar.prototype[p];
125 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
130 setSize : function(width, height){
131 if(!this.ignoreResize(width, height)){
132 var grid = this.grid;
133 var size = this.adjustForComponents(width, height);
134 grid.getGridEl().setSize(size.width, size.height);
139 beforeSlide : function(){
140 this.grid.getView().scroller.clip();
143 afterSlide : function(){
144 this.grid.getView().scroller.unclip();
147 destroy : function(){
148 // this.grid.destroy();
150 Roo.GridPanel.superclass.destroy.call(this);
155 this.onRender(this.el, false)
158 onRender : function(ct, position)
163 this.rendered = true;
165 Roo.log("render calendar");
167 //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
170 var cfg = Roo.apply({}, this.getAutoCreate());
173 // fill in the extra attributes
174 if (this.xattr && typeof(this.xattr) =='object') {
175 for (var i in this.xattr) {
176 cfg[i] = this.xattr[i];
181 cfg.dataId = this.dataId;
185 cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
188 if (this.style) { // fixme needs to support more complex style data.
189 cfg.style = this.style;
193 cfg.name = this.name;
196 this.el = ct.createChild(cfg, position);
198 if(this.tabIndex !== undefined){
199 this.el.dom.setAttribute('tabIndex', this.tabIndex);
205 getAutoCreate : Roo.bootstrap.Calendar.prototype.getAutoCreate,
207 initEvents : Roo.bootstrap.Calendar.prototype.initEvents