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(Roo.apply({
45 skipMonthHeader : false
50 this.on('activate', function()
54 //console.log('render tree');
61 * Fires when a date is selected
62 * @param {DatePicker} this
63 * @param {Date} date The selected date
68 * Fires when the displayed month changes
69 * @param {DatePicker} this
70 * @param {Date} date The selected month
75 * Fires when mouse over an event
76 * @param {Calendar} this
77 * @param {event} Event
82 * Fires when the mouse leaves an
83 * @param {Calendar} this
89 * Fires when the mouse click an
90 * @param {Calendar} this
96 * Fires when the grid is rendered
97 * @param {Calendar} this
104 this.relayEvents(this.view, ["select","monthchange","evententer","eventleave","rendered"]);
107 //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
111 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
116 var ct = this.el.appendChild(document.createElement("div"));
117 this.onRender(this.el, false)
120 onRender : function(ct, position)
125 this.rendered = true;
127 Roo.log("render calendar");
130 //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
133 var cfg = Roo.apply({}, this.view.getAutoCreate());
136 // fill in the extra attributes
137 if (this.xattr && typeof(this.xattr) =='object') {
138 for (var i in this.xattr) {
139 cfg[i] = this.xattr[i];
144 cfg.dataId = this.dataId;
148 cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
151 if (this.style) { // fixme needs to support more complex style data.
152 cfg.style = this.style;
156 cfg.name = this.name;
159 this.view.el = ct.createChild(cfg, position);
161 //if(this.tabIndex !== undefined){
162 // this.el.dom.setAttribute('tabIndex', this.tabIndex);
166 this.view.initEvents();
167 this.fireEvent('rendered');