Welcome,
Guest
|
|
I tried copying and pasting the customNewEventTemplate and replacing the onNewEvent() method in the calendar.php with the one in the examples/custometemplate \'s onNewEvent method. it does not replace the default template with the new one.
function onNewEvent(obj, groups, allday)
{
var st = new UTC(obj.startTime);
var ed = new UTC(obj.endTime);
var newevt=jQuery(\"#customNewEventTemplate\");
//Clear out and reset form
newevt.find(\"#eventDesc\").val(\"\").end()
.find(\"#eventName\").val(\"\").focus().end()
.find(\"#eventStartDate\").val( st.toStandardFormat()).end()
.find(\"#eventEndDate\").val(ed.toStandardFormat() ).end();
if(allday)
newevt.find(\"#allDayEvent\").attr(\"checked\", true).end()
.find(\"#eventStartTime\").val(\"\").end()
.find(\"#eventEndTime\").val(\"\");
else
newevt.find(\"#allDayEvent\").attr(\"checked\", false).end()
.find(\"#eventStartTime\").val( st.toNiceTime() ).end()
.find(\"#eventEndTime\").val( ed.toNiceTime() );
//display a list of groups to select from.
var groupDD=newevt.find(\"#eventGroup\").get(0);
removeAllOptions(groupDD);
for(var g in groups)
{
if(!groups.hasOwnProperty(g))continue;
var gId = groups[g].groupId;
addOption(groupDD, groups[g].groupName,groups[g].groupId,false);
}
if(obj.group && obj.group.groupId)
newevt.find(\"#eventGroup\").val(obj.group.groupId);
newevt.find(\"#newEvAddEventBtn\").show().end()
.find(\"#newEvUpdateEventBtn\").hide();
} any ideas what I may have left out? thanks in advance. |
Please Log in to join the conversation.
phillipkuo.com
|
|
I\'m assuming it is this:
function drawCalendar()
{
ical = new Web2Cal(\'calendarContainer\', {
loadEvents: loadCalendarEvents,
onUpdateEvent: updateEvent,
onNewEvent: onNewEvent,
previewTemplate: \"customPTemplate\",
views: \"day, month, week, custom\"
});
ical.build();
} |
Please Log in to join the conversation.
phillipkuo.com
|
|
You must specify to Web2Cal, the ID of the Custom Template you created as shown below.
Post back if this works. function drawCalendar() { ical = new Web2Cal(\'calendarContainer\', { loadEvents: loadCalendarEvents, onUpdateEvent: updateEvent, onNewEvent: onNewEvent, previewTemplate: \"customPTemplate\", newEventTemplate: \"customNewEventTemplate\", views: \"day, month, week, custom\" }); ical.build(); } |
Please Log in to join the conversation. Team Web2Cal. |