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
90 * Fires when the grid is rendered
91 * @param {Calendar} this
100 //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
104 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
112 setSize : function(width, height){
113 if(!this.ignoreResize(width, height)){
114 var grid = this.grid;
115 var size = this.adjustForComponents(width, height);
116 grid.getGridEl().setSize(size.width, size.height);
121 beforeSlide : function(){
122 this.grid.getView().scroller.clip();
125 afterSlide : function(){
126 this.grid.getView().scroller.unclip();
129 destroy : function(){
130 // this.grid.destroy();
132 Roo.GridPanel.superclass.destroy.call(this);
137 this.onRender(this.el, false)
140 onRender : function(ct, position)
145 this.rendered = true;
147 Roo.log("render calendar");
149 //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
152 var cfg = Roo.apply({}, this.getAutoCreate());
155 // fill in the extra attributes
156 if (this.xattr && typeof(this.xattr) =='object') {
157 for (var i in this.xattr) {
158 cfg[i] = this.xattr[i];
163 cfg.dataId = this.dataId;
167 cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
170 if (this.style) { // fixme needs to support more complex style data.
171 cfg.style = this.style;
175 cfg.name = this.name;
178 this.el = ct.createChild(cfg, position);
180 if(this.tabIndex !== undefined){
181 this.el.dom.setAttribute('tabIndex', this.tabIndex);
186 this.fireEvent('rendered');
221 Roo.CalendarPanel.prototype[p] = Roo.bootstrap.Calendar.prototype[p];