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     Roo.log("cal panel ctr");
22   
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);
25         
26     //this.wrapper.dom.appendChild(grid.getGridEl().dom);
27     
28     Roo.CalendarPanel.superclass.constructor.call(this, this.wrapper, config);
29     
30     if(this.toolbar){
31         this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
32     }
33     // xtype created footer. - not sure if will work as we normally have to render first..
34     if (this.footer && !this.footer.el && this.footer.xtype) {
35         
36         //this.footer.container = this.grid.getView().getFooterPanel(true);
37         //this.footer.dataSource = this.grid.dataSource;
38         //this.footer = Roo.factory(this.footer, Roo);
39         
40     }
41     
42     this.on('activate', function()
43     {
44         Roo.log('activate');
45         if (this.rendered) {
46             return;
47         }
48         this.rendered = true;
49         //console.log('render tree');
50         this.render();
51     },true);
52     
53     this.addEvents({
54         /**
55              * @event select
56              * Fires when a date is selected
57              * @param {DatePicker} this
58              * @param {Date} date The selected date
59              */
60         'select': true,
61         /**
62              * @event monthchange
63              * Fires when the displayed month changes 
64              * @param {DatePicker} this
65              * @param {Date} date The selected month
66              */
67         'monthchange': true,
68         /**
69              * @event evententer
70              * Fires when mouse over an event
71              * @param {Calendar} this
72              * @param {event} Event
73              */
74         'evententer': true,
75         /**
76              * @event eventleave
77              * Fires when the mouse leaves an
78              * @param {Calendar} this
79              * @param {event}
80              */
81         'eventleave': true,
82         /**
83              * @event eventclick
84              * Fires when the mouse click an
85              * @param {Calendar} this
86              * @param {event}
87              */
88         'eventclick': true
89         
90     });
91     
92     //this.grid = grid;
93     //this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
94 };
95
96 Roo.extend(Roo.CalendarPanel, Roo.ContentPanel, {
97     getId : function(){
98         return this.id;
99     },
100     /*
101     setSize : function(width, height){
102         if(!this.ignoreResize(width, height)){
103             var grid = this.grid;
104             var size = this.adjustForComponents(width, height);
105             grid.getGridEl().setSize(size.width, size.height);
106             grid.autoSize();
107         }
108     },
109     
110     beforeSlide : function(){
111         this.grid.getView().scroller.clip();
112     },
113     
114     afterSlide : function(){
115         this.grid.getView().scroller.unclip();
116     },
117     */
118     destroy : function(){
119       //  this.grid.destroy();
120        // delete this.grid;
121          Roo.GridPanel.superclass.destroy.call(this); 
122     },
123     
124     
125     render : function()
126     {
127         
128         Roo.log("render calendar");
129         
130         
131     }
132     
133 });