Roo/CalendarPanel.js
[roojs1] / Roo / CalendarPanel.js
1 /*
2  * - LGPL
3  *
4  * based on jquery fullcalendar
5  * 
6  */
7
8
9 /**
10  * @class Roo.Calendar
11  * @extends Roo.Component
12  * Bootstrap Calendar class
13     
14  * @constructor
15  * Create a new Container
16  * @param {Object} config The config object
17  */
18
19 Roo.CalendarPanel = function(config){
20     
21   
22     this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
23         {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
24         
25     //this.wrapper.dom.appendChild(grid.getGridEl().dom);
26     
27     Roo.CalendarPanel.superclass.constructor.call(this, this.wrapper, config);
28     
29     if(this.toolbar){
30         this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
31     }
32     // xtype created footer. - not sure if will work as we normally have to render first..
33     if (this.footer && !this.footer.el && this.footer.xtype) {
34         
35         //this.footer.container = this.grid.getView().getFooterPanel(true);
36         //this.footer.dataSource = this.grid.dataSource;
37         //this.footer = Roo.factory(this.footer, Roo);
38         
39     }
40     
41      this.on('activate', function()
42     {
43             Roo.log('activate');
44         if (this.rendered) {
45             return;
46         }
47         this.rendered = true;
48         //console.log('render tree');
49         this.render();
50     },true);
51     
52     this.addEvents({
53         /**
54              * @event select
55              * Fires when a date is selected
56              * @param {DatePicker} this
57              * @param {Date} date The selected date
58              */
59         'select': true,
60         /**
61              * @event monthchange
62              * Fires when the displayed month changes 
63              * @param {DatePicker} this
64              * @param {Date} date The selected month
65              */
66         'monthchange': true,
67         /**
68              * @event evententer
69              * Fires when mouse over an event
70              * @param {Calendar} this
71              * @param {event} Event
72              */
73         'evententer': true,
74         /**
75              * @event eventleave
76              * Fires when the mouse leaves an
77              * @param {Calendar} this
78              * @param {event}
79              */
80         'eventleave': true,
81         /**
82              * @event eventclick
83              * Fires when the mouse click an
84              * @param {Calendar} this
85              * @param {event}
86              */
87         'eventclick': true
88         
89     });
90     
91     //this.grid = grid;
92     //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
93 };
94
95 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
96     getId : function(){
97         return this.id;
98     },
99     /*
100     setSize : function(width, height){
101         if(!this.ignoreResize(width, height)){
102             var grid = this.grid;
103             var size = this.adjustForComponents(width, height);
104             grid.getGridEl().setSize(size.width, size.height);
105             grid.autoSize();
106         }
107     },
108     
109     beforeSlide : function(){
110         this.grid.getView().scroller.clip();
111     },
112     
113     afterSlide : function(){
114         this.grid.getView().scroller.unclip();
115     },
116     */
117     destroy : function(){
118       //  this.grid.destroy();
119        // delete this.grid;
120          Roo.GridPanel.superclass.destroy.call(this); 
121     },
122     
123     
124     render : function()
125     {
126         
127         Roo.log("render calendar");
128         
129         
130     }
131     
132 });