Upgrade to ExtJS 3.3.1 - Released 11/30/2010
[extjs.git] / examples / docs / source / DayHeaderTemplate.html
1 <html>
2 <head>
3   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />    
4   <title>The source code</title>
5     <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6     <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 </head>
8 <body  onload="prettyPrint();">
9     <pre class="prettyprint lang-js">/*!
10  * Ext JS Library 3.3.1
11  * Copyright(c) 2006-2010 Sencha Inc.
12  * licensing@sencha.com
13  * http://www.sencha.com/license
14  */
15 <div id="cls-Ext.calendar.DayHeaderTemplate"></div>/**
16  * @class Ext.calendar.DayHeaderTemplate
17  * @extends Ext.XTemplate
18  * <p>This is the template used to render the all-day event container used in {@link Ext.calendar.DayView DayView} and 
19  * {@link Ext.calendar.WeekView WeekView}. Internally the majority of the layout logic is deferred to an instance of
20  * {@link Ext.calendar.BoxLayoutTemplate}.</p> 
21  * <p>This template is automatically bound to the underlying event store by the 
22  * calendar components and expects records of type {@link Ext.calendar.EventRecord}.</p>
23  * <p>Note that this template would not normally be used directly. Instead you would use the {@link Ext.calendar.DayViewTemplate}
24  * that internally creates an instance of this template along with a {@link Ext.calendar.DayBodyTemplate}.</p>
25  * @constructor
26  * @param {Object} config The config object
27  */
28 Ext.calendar.DayHeaderTemplate = function(config){
29     
30     Ext.apply(this, config);
31     
32     this.allDayTpl = new Ext.calendar.BoxLayoutTemplate(config);
33     this.allDayTpl.compile();
34     
35     Ext.calendar.DayHeaderTemplate.superclass.constructor.call(this,
36         '<div class="ext-cal-hd-ct">',
37             '<table class="ext-cal-hd-days-tbl" cellspacing="0" cellpadding="0">',
38                 '<tbody>',
39                     '<tr>',
40                         '<td class="ext-cal-gutter"></td>',
41                         '<td class="ext-cal-hd-days-td"><div class="ext-cal-hd-ad-inner">{allDayTpl}</div></td>',
42                         '<td class="ext-cal-gutter-rt"></td>',
43                     '</tr>',
44                 '</tobdy>',
45             '</table>',
46         '</div>'
47     );
48 };
49
50 Ext.extend(Ext.calendar.DayHeaderTemplate, Ext.XTemplate, {
51     applyTemplate : function(o){
52         return Ext.calendar.DayHeaderTemplate.superclass.applyTemplate.call(this, {
53             allDayTpl: this.allDayTpl.apply(o)
54         });
55     }
56 });
57
58 Ext.calendar.DayHeaderTemplate.prototype.apply = Ext.calendar.DayHeaderTemplate.prototype.applyTemplate;
59 </pre>    
60 </body>
61 </html>