Hi Daniil!
Thanks a lot for your javascript code... Works very fine...
For Day View and WeekDay View, I follow your javascript code for month view, merging with your code passed in another thread (
http://forums.ext.net/showthread.php?18093)... and works fine too...
Thanks a lot, again... Follow the complete code...
Ext.calendar.view.Month.override({
getTemplateEventData: function (evt) {
var M = Ext.calendar.data.EventMappings,
selector = this.getEventSelectorCls(evt[M.EventId.name]),
title = evt[M.Title.name];
return Ext.applyIf({
_selectorCls: selector,
_colorCls: 'ext-color-' + (evt[M.CalendarId.name] ?
evt[M.CalendarId.name] : 'default') + (evt._renderAsAllDay ? '-ad' : ''),
_elId: selector + '-' + evt._weekIndex,
_isRecurring: evt.Recurrence && evt.Recurrence != '',
_isReminder: evt[M.Reminder.name] && evt[M.Reminder.name] != '',
//Title: (evt[M.IsAllDay.name] ? '' : Ext.Date.format(evt[M.StartDate.name], 'g:ia ')) + (!title || title.length == 0 ? '(No title)' : title)
Title: (evt[M.IsAllDay.name] ? '' : Ext.Date.format(evt[M.StartDate.name], 'H:i ')) + (!title || title.length == 0 ? '(No title)' : title),
Location : evt[M.Location.name], // added
Notes : evt[M.Notes.name] // added
},
evt);
},
getEventBodyMarkup: function () {
if (!this.eventBodyMarkup) {
this.eventBodyMarkup = ['{Title}',
'<br/>{Location}', // added
'<br/>{Notes}', // added
'<tpl if="_isReminder">',
'<i class="ext-cal-ic ext-cal-ic-rem"> </i>',
'</tpl>',
'<tpl if="_isRecurring">',
'<i class="ext-cal-ic ext-cal-ic-rcr"> </i>',
'</tpl>',
'<tpl if="spanLeft">',
'<i class="ext-cal-spl"> </i>',
'</tpl>',
'<tpl if="spanRight">',
'<i class="ext-cal-spr"> </i>',
'</tpl>'
].join('');
}
return this.eventBodyMarkup;
}
});
Ext.calendar.view.DayBody.override({
getTemplateEventData: function (evt) {
var selector = this.getEventSelectorCls(evt[Ext.calendar.data.EventMappings.EventId.name]),
data = {},
M = Ext.calendar.data.EventMappings;
this.getTemplateEventBox(evt);
data._selectorCls = selector;
data._colorCls = 'ext-color-' + (evt[M.CalendarId.name] || '0') + (evt._renderAsAllDay ? '-ad' : '');
data._elId = selector + (evt._weekIndex ? '-' + evt._weekIndex : '');
data._isRecurring = evt.Recurrence && evt.Recurrence != '';
data._isReminder = evt[M.Reminder.name] && evt[M.Reminder.name] != '';
var title = evt[M.Title.name];
//data.Title = (evt[M.IsAllDay.name] ? '': Ext.Date.format(evt[M.StartDate.name], 'g:ia ')) + (!title || title.length == 0 ? '(No title)': title);
data.Title = (evt[M.IsAllDay.name] ? '' : Ext.Date.format(evt[M.StartDate.name], 'H:i ')) + (!title || title.length == 0 ? '(No title)' : title);
data.Location = evt[M.Location.name]; // added
data.Notes = evt[M.Notes.name]; // added
return Ext.applyIf(data, evt);
},
getEventBodyMarkup: function () {
if (!this.eventBodyMarkup) {
this.eventBodyMarkup = ['{Title}',
'<br/>{Location}', // added
'<br/>{Notes}', // added
'<tpl if="_isReminder">',
'<i class="ext-cal-ic ext-cal-ic-rem"> </i>',
'</tpl>',
'<tpl if="_isRecurring">',
'<i class="ext-cal-ic ext-cal-ic-rcr"> </i>',
'</tpl>',
'<tpl if="spanLeft">',
'<i class="ext-cal-spl"> </i>',
'</tpl>',
'<tpl if="spanRight">',
'<i class="ext-cal-spr"> </i>',
'</tpl>'
].join('');
}
return this.eventBodyMarkup;
}
});