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: group goes away on edit?

group goes away on edit? 14 years 3 months ago #324

  • philltx
  • philltx's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0
I noticed when I click on the edit button while updating an event, the group drop down population goes away. However it remains when you create a new event.

Is this suppposed to happen? How do i get it to populate again when updating an existing event?

I\'m assuming its this code which is listing the calendar groups.
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(\"#eventDescription\").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 g = groups[g].groupId;
				addOption(groupDD, groups[g].groupName,groups[g].groupId,false);
			}  //end for 
			if(obj.group && obj.group.groupId)	
				newevt.find(\"#eventGroup\").val(obj.group.groupId); 
			
			
				newevt.find(\"#newEvAddEventBtn\").show().end()
				.find(\"#newEvUpdateEventBtn\").hide();
	    
    } //end onNewEvent

Please Log in to join the conversation.

phillipkuo.com

Re:group goes away on edit? 14 years 3 months ago #326

  • philltx
  • philltx's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0
I noticed the editEvent.html and the other examples, the group drop down is also not working.

any ideas on the best way to do this? Is this something available in the commercial version?

I would really like to add more database populated drop down options.

Please Log in to join the conversation.

phillipkuo.com

Re:group goes away on edit? 14 years 3 months ago #327

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 143
  • Karma: 1
  • Thank you received: 1
Yes, It is very simple in Premium Versions. There are many convenient functions. But you can accomplish the same with Basic also.

Basically, I am keeping the list of groups I provided in a local variable. In Premium, you could call, ical.getAllGroups() to get list of groups.

var allEvents;
function loadCalendarEvents()
{
ical.render(events);
allEvents = events;
}

Function editEvent()
{
var groupDD=newevt.find(\"#eventGroup\").get(0);
removeAllOptions(groupDD);
for(var g in allEvents)
{
if(!allEvents.hasOwnProperty(g))continue;
var g = allEvents[g].groupId;
addOption(groupDD, allEvents[g].groupName,allEvents[g].groupId,false);
} //end for
}

Let me know if this helps

Please Log in to join the conversation.


Team Web2Cal.

Re:group goes away on edit? 14 years 3 months ago #328

  • philltx
  • philltx's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 24
  • Thank you received: 0
I understand you are setting Allgroups to events..

however why do you use events over lists? Where does lists come from in the php-example folder?

thanks

Please Log in to join the conversation.

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

LATEST IN FORUM

  • No posts to display.

ABOUT US