0
votes

I am using full calendar plugin. I have to populate calendar data coming from a workflow. I am getting those values in separate function and i have to pass it fullcalendar events.

I am not sure how will i get those values in event using javascript or jquery.

Below is the code which i am using:

$('#calendar1').fullCalendar({
    height: 450,
    selectable: true,
    theme: true,

    header: {
        left: 'prev,next today',
        center: 'title',
        right: 'month'
    },
    eventMouseover: function(data, event, view) {
        var content = '<h3>'+data.title+'</h3>' + 
        '<p><b>Start:</b> '+data.start+'<br />' + 
        (data.end && '<p><b>End:</b> '+data.end+'</p>' || '');
        tooltip.set({
            'content.text': content
        }).reposition(event).show(event);
    },
    events: [
        {
            "title":"val1",
            "allDay":true,
            "start":'2014-10-09 12:30:00',
            "id":12
        }
    ],

    eventColor: '#eb2323'
});

and the function in which the value is there:

function ShowScheduleAppointments() {
var pm = this.GetPM(),
outPS = pm.Get('resultSchedApp'),
resultSet = outPS.GetChildByType("ResultSet"),
text =(JSON.stringify(resultSet)),
obj = JSON.parse(text);

    var val1 = obj.childArray[0].childArray[0].childArray[0].childArray[3].childArray[0].childArray[0].value,
    val2 = obj.childArray[0].childArray[0].childArray[0].childArray[3].childArray[0].childArray[1].value,
    val3 = obj.childArray[0].childArray[0].childArray[0].childArray[3].childArray[0].childArray[2].value;
}

I want to pass these values val1, val2 and val3 as events start date id and title respectively.

1
I've used this before, going to see if I can find what code I used. I remember it was really simple, give me a few.IAteYourKitten

1 Answers

0
votes

I couldn't find my code, but I found a document outlining the process of adding events dynamically via ajax: http://fullcalendar.io/docs/event_data/events_function/