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);
43 this.view = new Roo.calendar.View(config);
46 this.on('activate', function()
50 //console.log('render tree');
57 * Fires when a date is selected
58 * @param {DatePicker} this
59 * @param {Date} date The selected date
64 * Fires when the displayed month changes
65 * @param {DatePicker} this
66 * @param {Date} date The selected month
71 * Fires when mouse over an event
72 * @param {Calendar} this
73 * @param {event} Event
78 * Fires when the mouse leaves an
79 * @param {Calendar} this
85 * Fires when the mouse click an
86 * @param {Calendar} this
92 * Fires when the grid is rendered
93 * @param {Calendar} this
100 this.relayEvents(this.view, ["select","monthchange","evententer","eventleave","rendered"]);
103 //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
107 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
112 var ct = this.el.appendChild(document.createElement("div"));
113 this.onRender(this.el, false)
116 onRender : function(ct, position)
121 this.rendered = true;
123 Roo.log("render calendar");
126 //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
129 var cfg = Roo.apply({}, this.getAutoCreate());
132 // fill in the extra attributes
133 if (this.xattr && typeof(this.xattr) =='object') {
134 for (var i in this.xattr) {
135 cfg[i] = this.xattr[i];
140 cfg.dataId = this.dataId;
144 cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
147 if (this.style) { // fixme needs to support more complex style data.
148 cfg.style = this.style;
152 cfg.name = this.name;
155 this.el = ct.createChild(cfg, position);
157 if(this.tabIndex !== undefined){
158 this.el.dom.setAttribute('tabIndex', this.tabIndex);
163 this.fireEvent('rendered');
198 Roo.CalendarPanel.prototype[p] = Roo.bootstrap.Calendar.prototype[p];