Menu
Welcome, Guest
Username: Password: Secret Key Remember me
Welcome to the Developer forum!
Get all your questions answered here. Learn to integrate calendar in your application.
  • Page:
  • 1

TOPIC: customNewEventTemplate not replacing default NewEvent template

customNewEventTemplate not replacing default NewEvent template 13 years 10 months ago #305

  • philltx
  • philltx's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0
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

Re: customNewEventTemplate not replacing default NewEvent template 13 years 10 months ago #306

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 143
  • Karma: 1
  • Thank you received: 1
Can you also paste your Web2Cal initialization code?

Please Log in to join the conversation.


Team Web2Cal.

Re:customNewEventTemplate not replacing default NewEvent template 13 years 10 months ago #307

  • philltx
  • philltx's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0
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

Re:customNewEventTemplate not replacing default NewEvent template 13 years 10 months ago #308

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 143
  • Karma: 1
  • Thank you received: 1
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.

Re:customNewEventTemplate not replacing default NewEvent template 13 years 10 months ago #309

  • philltx
  • philltx's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0
awesome, that fixed it! thanks

Please Log in to join the conversation.

phillipkuo.com
  • Page:
  • 1
Time to create page: 0.295 seconds
Powered by Kunena Forum

LATEST IN FORUM

  • No posts to display.

ABOUT US