| Issue 121: | Reading content from a SharePoint-list via webservice and creating new calendarentries from that | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Hello, I've already got back the XML-response from the listwebservice but how can I create calendarevents using the variables of the XML-response. I'm using FullCalendar Version 1.3.1 The SP-list looks like that: http://img517.imageshack.us/img517/962/sharepointlist.jpg -title should also be the title-object of the event -date is the start-object (not formatted yet) -Allday is the allDay eventobject -Creator should be shown when the user hovering an event Thats the way I normally add an event manually events:[ { id: 1, title: "Event1", start: "2009-10-12T16:00:00Z", allDay: true } ] I would be very happy about an answer. Thanks! Best regards Chris
Oct 13, 2009
Project Member
#1
adamrs...@gmail.com
Status:
Done
Oct 5, 2011
this is fairly simple to do using the events (as a function), and i imagine you could use the $.ajax of jQuery but i would recommend using SPServices (http://spservices.codeplex.com/). $('#calendar').fullCalendar({ editable: false, header: { left: 'prev today', center: 'title', right: 'month,basicWeek,agendaDay next' }, events: function(start, end, callback) { var a = $.fullCalendar.formatDate(start,'yyyy-MM-dd'); var b = $.fullCalendar.formatDate(end,'yyyy-MM-dd'); $().SPServices({ operation: 'GetListItems', listName: '{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}', CAMLQuery: '<Query><Where><And><Geq><FieldRef Name="EventDate" /><Value Type="DateTime">'+a+'</Value></Geq><Leq><FieldRef Name="EventDate" /><Value Type="DateTime">'+b+'</Value></Leq></And></Where></Query>', async: true, completefunc: function(xData,status){ var events = []; $(xData.responseXML).find("[nodeName='z:row']").each(function() { events.push({ title: $(this).attr('ows_Title'), start: $(this).attr('ows_EventDate'), end: $(this).attr('ows_EndDate') }); }); callback(events); } }); } }); this will not support reoccurring events, that's a whole other can of worms you can google. the CAMLQuery will ensure the only events grabbed are between the dates in the calendar view. |
|
| ► Sign in to add a comment |