3 * Copyright(c) 2006-2010 Sencha Inc.
5 * http://www.sencha.com/license
8 * @class Ext.calendar.DayHeaderView
9 * @extends Ext.calendar.MonthView
10 * <p>This is the header area container within the day and week views where all-day events are displayed.
11 * Normally you should not need to use this class directly -- instead you should use {@link Ext.calendar.DayView DayView}
12 * which aggregates this class and the {@link Ext.calendar.DayBodyView DayBodyView} into the single unified view
13 * presented by {@link Ext.calendar.CalendarPanel CalendarPanel}.</p>
15 * @param {Object} config The config object
17 Ext.calendar.DayHeaderView = Ext.extend(Ext.calendar.MonthView, {
26 * Fires after the user clicks within the day view container and not on an event element
27 * @param {Ext.calendar.DayBodyView} this
28 * @param {Date} dt The date/time that was clicked on
29 * @param {Boolean} allday True if the day clicked on represents an all-day box, else false. Clicks within the
30 * DayHeaderView always return true for this param.
31 * @param {Ext.Element} el The Element that was clicked on
35 afterRender: function() {
37 this.tpl = new Ext.calendar.DayHeaderTemplate({
39 showTodayText: this.showTodayText,
40 todayText: this.todayText,
41 showTime: this.showTime
45 this.addClass('ext-cal-day-header');
47 Ext.calendar.DayHeaderView.superclass.afterRender.call(this);
51 forceSize: Ext.emptyFn,
55 Ext.calendar.DayHeaderView.superclass.refresh.call(this);
56 this.recalcHeaderBox();
60 recalcHeaderBox: function() {
61 var tbl = this.el.child('.ext-cal-evt-tbl'),
64 this.el.setHeight(h + 7);
66 if (Ext.isIE && Ext.isStrict) {
67 this.el.child('.ext-cal-hd-ad-inner').setHeight(h + 4);
70 //TODO: figure out why Opera refuses to refresh height when
71 //the new height is lower than the previous one
72 // var ct = this.el.child('.ext-cal-hd-ct');
78 moveNext: function(noRefresh) {
79 this.moveDays(this.dayCount, noRefresh);
83 movePrev: function(noRefresh) {
84 this.moveDays( - this.dayCount, noRefresh);
88 onClick: function(e, t) {
89 var el = e.getTarget('td', 3),
93 if (el.id && el.id.indexOf(this.dayElIdDelimiter) > -1) {
94 parts = el.id.split(this.dayElIdDelimiter);
95 dt = parts[parts.length - 1];
97 this.fireEvent('dayclick', this, Date.parseDate(dt, 'Ymd'), true, Ext.get(this.getDayId(dt)));
101 Ext.calendar.DayHeaderView.superclass.onClick.apply(this, arguments);
105 Ext.reg('dayheaderview', Ext.calendar.DayHeaderView);