Upgrade to ExtJS 3.3.0 - Released 10/06/2010
[extjs.git] / examples / calendar / src / templates / DayViewTemplate.js
1 /*!
2  * Ext JS Library 3.3.0
3  * Copyright(c) 2006-2010 Ext JS, Inc.
4  * licensing@extjs.com
5  * http://www.extjs.com/license
6  */
7 /**
8  * @class Ext.calendar.DayViewTemplate
9  * @extends Ext.XTemplate
10  * <p>This is the template used to render the all-day event container used in {@link Ext.calendar.DayView DayView} and 
11  * {@link Ext.calendar.WeekView WeekView}. Internally this class simply defers to instances of {@link Ext.calerndar.DayHeaderTemplate}
12  * and  {@link Ext.calerndar.DayBodyTemplate} to perform the actual rendering logic, but it also provides the overall calendar view
13  * container that contains them both.  As such this is the template that should be used when rendering day or week views.</p> 
14  * <p>This template is automatically bound to the underlying event store by the 
15  * calendar components and expects records of type {@link Ext.calendar.EventRecord}.</p>
16  * @constructor
17  * @param {Object} config The config object
18  */
19 Ext.calendar.DayViewTemplate = function(config){
20     
21     Ext.apply(this, config);
22     
23     this.headerTpl = new Ext.calendar.DayHeaderTemplate(config);
24     this.headerTpl.compile();
25     
26     this.bodyTpl = new Ext.calendar.DayBodyTemplate(config);
27     this.bodyTpl.compile();
28     
29     Ext.calendar.DayViewTemplate.superclass.constructor.call(this,
30         '<div class="ext-cal-inner-ct">',
31             '{headerTpl}',
32             '{bodyTpl}',
33         '</div>'
34     );
35 };
36
37 Ext.extend(Ext.calendar.DayViewTemplate, Ext.XTemplate, {
38     // private
39     applyTemplate : function(o){
40         return Ext.calendar.DayViewTemplate.superclass.applyTemplate.call(this, {
41             headerTpl: this.headerTpl.apply(o),
42             bodyTpl: this.bodyTpl.apply(o)
43         });
44     }
45 });
46
47 Ext.calendar.DayViewTemplate.prototype.apply = Ext.calendar.DayViewTemplate.prototype.applyTemplate;