I’m trying to figure out how to refresh the event calendar after the user has inserted a new event. I’ve tried both of the following and I don’t know what these are supposed to do but they don’t actually reload the event calendar.
$('#staffschedule').mobiscroll('refresh');
$('#staffschedule').mobiscroll('getEvents');
This is how I’m initializing the calendar. So how do I refresh it?
$(function () {
//<!--*********************************************************************************-->
//<!--*** Initialize event calendar
//<!--*********************************************************************************-->
var inst = $('#staffschedule').mobiscroll().eventcalendar({
display: 'inline',
showEventCount: 'true',
theme: 'ios',
themeVariant: 'light',
view: {
calendar: {
labels: true,
type: 'week',
popover: true
},
eventList: {type: 'week', scrollable: true}
},
onEventSelect: function (event, inst) {
mobiscroll.toast({
message: event.event.text
});
},
onBeforeShow: function (event, inst) {
alert("before show");
}
}).mobiscroll('getInst');
mobiscroll.util.getJson('get-staffschedule.json.php?staffid=<?=$staffid?>', function (events) {
inst.setEvents(events);
}, 'json');
});