aneuroo
aneuroo

Reputation: 85

Pass another parameter to Fulcalendar

Here is the code, the "events: url," part of the code is coming through into my fullcalendar.js file and adds the events however I also want to add a list of users from json data like so users:'urlusers'

Will I have to edit the fullcalendar.js file and if so where can I add another parameter for the users.

$(document).ready(function() {
var calendar = $('#calendar').fullCalendar({
defaultView: 'agendaWeek',
minTime: "08:00:00",
maxTime: "20:00:00",
editable:false, 
header:{
 left:'prev,next today',
 center:'title',

},
events: 'https://events.com/eventsjson',
users:'https://events.com/usersjson',
selectable:true,
selectHelper:true,
select: function(start, end, allDay)
{
 var titlestart = $.fullCalendar.formatDate(start, "DD-MM-Y HH:mm:ss");


 var r = confirm("Request Time " + titlestart);
 if (r == true) {
           event.preventDefault();
           //Open dialog
        var subject = 'Booking '+titlestart;
        var emailBody = 'Create booking for '+titlestart    
           showDialog(titlestart);
 } else {

 }
},
});
});

Upvotes: 0

Views: 121

Answers (1)

aneuroo
aneuroo

Reputation: 85

Not the solution I was thinking of but got the result.

on the events: 'https://events.com/eventsjson', I needed to add more data to the JSON then the fullcalendar sorted the rest out for me

foreach($result as $row)
{
 $data[] = array(
     'id'   => $row["user_id"],
     'start'   => $row["startevent"],
     'end'   => $row["endevent"],
     'backgroundColor'   => $row["backgroundColor"],
     'borderColor'   => $row["borderColor"]
    );
}

Upvotes: 1

Related Questions