3 * Copyright(c) 2006-2010 Ext JS, Inc.
5 * http://www.extjs.com/license
8 * @class Ext.calendar.MonthViewTemplate
\r
9 * @extends Ext.XTemplate
\r
10 * <p>This is the template used to render the {@link Ext.calendar.MonthView MonthView}. Internally this class defers to an
\r
11 * instance of {@link Ext.calerndar.BoxLayoutTemplate} to handle the inner layout rendering and adds containing elements around
\r
12 * that to form the month view.</p>
\r
13 * <p>This template is automatically bound to the underlying event store by the
\r
14 * calendar components and expects records of type {@link Ext.calendar.EventRecord}.</p>
\r
16 * @param {Object} config The config object
\r
18 Ext.calendar.MonthViewTemplate = function(config){
\r
20 Ext.apply(this, config);
\r
22 this.weekTpl = new Ext.calendar.BoxLayoutTemplate(config);
\r
23 this.weekTpl.compile();
\r
25 var weekLinkTpl = this.showWeekLinks ? '<div class="ext-cal-week-link-hd"> </div>' : '';
\r
27 Ext.calendar.MonthViewTemplate.superclass.constructor.call(this,
\r
28 '<div class="ext-cal-inner-ct {extraClasses}">',
\r
29 '<div class="ext-cal-hd-ct ext-cal-month-hd">',
\r
31 '<table class="ext-cal-hd-days-tbl" cellpadding="0" cellspacing="0">',
\r
35 '<th class="ext-cal-hd-day{[xindex==1 ? " ext-cal-day-first" : ""]}" title="{.:date("l, F j, Y")}">{.:date("D")}</th>',
\r
41 '<div class="ext-cal-body-ct">{weeks}</div>',
\r
46 Ext.extend(Ext.calendar.MonthViewTemplate, Ext.XTemplate, {
\r
48 applyTemplate : function(o){
\r
50 weeks = this.weekTpl.apply(o),
\r
53 for(var i = 0; i < 7; i++){
\r
54 days.push(dt.add(Date.DAY, i));
\r
57 var extraClasses = this.showHeader === true ? '' : 'ext-cal-noheader';
\r
58 if(this.showWeekLinks){
\r
59 extraClasses += ' ext-cal-week-links';
\r
62 return Ext.calendar.MonthViewTemplate.superclass.applyTemplate.call(this, {
\r
65 extraClasses: extraClasses
\r
70 Ext.calendar.MonthViewTemplate.prototype.apply = Ext.calendar.MonthViewTemplate.prototype.applyTemplate;
\r