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", ns: true}, true);
25 Roo.log(this.warpper);
27 // Roo.log(Roo.DomHelper.append(document.body),{}, true);
29 //this.wrapper.dom.appendChild(grid.getGridEl().dom);
31 Roo.CalendarPanel.superclass.constructor.call(this, this.wrapper, config);
36 this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
38 // xtype created footer. - not sure if will work as we normally have to render first..
39 if (this.footer && !this.footer.el && this.footer.xtype) {
41 //this.footer.container = this.grid.getView().getFooterPanel(true);
42 //this.footer.dataSource = this.grid.dataSource;
43 //this.footer = Roo.factory(this.footer, Roo);
46 this.view = new Roo.calendar.View(Roo.apply({
48 skipMonthHeader : true
53 this.on('activate', function()
55 Roo.log('CalendarPanel.js activate');
57 //console.log('render tree');
64 * Fires when a date is selected
65 * @param {DatePicker} this
66 * @param {Date} date The selected date
71 * Fires when the displayed month changes
72 * @param {DatePicker} this
73 * @param {Date} date The selected month
78 * Fires when mouse over an event
79 * @param {Calendar} this
80 * @param {event} Event
85 * Fires when the mouse leaves an
86 * @param {Calendar} this
92 * Fires when the mouse click an
93 * @param {Calendar} this
99 * Fires when the grid is rendered
100 * @param {Calendar} this
107 this.relayEvents(this.view, ["select","monthchange","evententer","eventleave","rendered"]);
110 //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
114 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
119 var ct = this.el.appendChild(document.createElement("div"));
120 this.onRender(this.el, false)
123 onRender : function(ct, position)
128 this.rendered = true;
130 Roo.log("CalendarPanel.js render calendar");
133 //Roo.bootstrap.Component.superclass.onRender.call(this, ct, position);
136 var cfg = Roo.apply({}, this.view.getAutoCreate());
139 // fill in the extra attributes
140 if (this.xattr && typeof(this.xattr) =='object') {
141 for (var i in this.xattr) {
142 cfg[i] = this.xattr[i];
147 cfg.dataId = this.dataId;
151 cfg.cls = (typeof(cfg.cls) == 'undefined') ? this.cls : cfg.cls + ' ' + this.cls;
154 if (this.style) { // fixme needs to support more complex style data.
155 cfg.style = this.style;
159 cfg.name = this.name;
162 this.view.el = ct.createChild(cfg, position);
163 Roo.log('this.view');
165 //if(this.tabIndex !== undefined){
166 // this.el.dom.setAttribute('tabIndex', this.tabIndex);
170 this.view.initEvents();
171 this.fireEvent('rendered');