You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Embed resources directly using PHP variable
var resources = @json($staffs);
var calendarEl = document.getElementById('calendar');
var calendar = new EventCalendar(calendarEl, {
view: 'resourceTimelineWeek',
firstDay: 1,
slotDuration: {days: 1},
headerToolbar: {
start: 'prev,next today',
center: 'title',
end: 'resourceTimelineWeek'
},
eventSources: [
{
url: '/attendance/resourcesAndAttendance',
method: 'GET',
failure: function() {
alert('There was an error while fetching events!');
}
}
],
views: {
resourceTimelineWeek: {
pointer: true,
resources: resources
}
},
dayMaxEvents: true,
nowIndicator: true,
selectable: false
});
});
</script>`
I use the above code but it looks like the calendar loads resources at initialization and does not automatically refresh them when I fetch events.
Basically, I have server side code that will return only the required resources and their events, and would like the calendar to fetch and load these dataset at runtime. Any suggestions?
The text was updated successfully, but these errors were encountered:
`<script>
document.addEventListener('DOMContentLoaded', function() {
</script>`
I use the above code but it looks like the calendar loads resources at initialization and does not automatically refresh them when I fetch events.
Basically, I have server side code that will return only the required resources and their events, and would like the calendar to fetch and load these dataset at runtime. Any suggestions?
The text was updated successfully, but these errors were encountered: