Event Hooks
The agenda ships with different hooks for deep customization. Events are triggered through the lifecycle of the component where you can tie in custom functionality and code.
While users interact with the UI events like onEventClick, onInit, onSelectedDateChange ... will be triggered.
For a complete list of events go to the documentation See available lifecycle events →
Demo
onDestroy: function (event, inst) { /* Logic for destroying the event calendar */ },
onEventClick: function (event, inst) { /* Logic for event click */ },
onEventDoubleClick: function (event, inst) { /* Logic for event double click */ },
onEventHoverIn: function (event, inst) { /* Logic for event hover in */ },
onEventHoverOut: function (event, inst) { /* Logic for event hover out */ },
onEventRightClick: function (event, inst) { /* Logic for event right click */ },
onInit: function (event, inst) { /* Logic running on component init */ },
onPageChange: function (event, inst) { /* Your custom event handler goes here */ },
onPageLoaded: function (event, inst) { /* Use it to inject custom markup & attach custom listeners */ },
onPageLoading: function (event, inst) { /* Use it to load data on demand */ },
onSelectedDateChange: function (event, inst) { /* Use it to keep track of the selected date externally */ }
Event log

JSHTML
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
var inst = mobiscroll.eventcalendar('#demo-event-hooks', {
view: {
agenda: { type: 'month' },
},
onDestroy: function () {
// Logic running on component destroy
console.log('onDestroy');
},
onEventClick: function (args) {
// Logic for event click
console.log('onEventClick', args);
},
onEventDoubleClick: function (args) {
// Logic for event double click
console.log('onEventDoubleClick', args);
},
onEventHoverIn: function (args) {
// Logic for event hover in
console.log('onEventHoverIn', args);
},
onEventHoverOut: function (args) {
// Logic for event hover out
console.log('onEventHoverOut', args);
},
onEventRightClick: function (args) {
// Logic for event right click
console.log('onEventRightClick', args);
},
onInit: function () {
// Logic running on component init
console.log('onInit');
},
onPageChange: function (args) {
// Logic running on calendar page change
console.log('onPageChange', args);
},
onPageLoaded: function (args) {
// Use it to inject custom markup & attach custom listeners
console.log('onPageLoaded', args);
},
onPageLoading: function (args) {
// Use it to load data on demand
console.log('onPageLoading', args);
},
onSelectedDateChange: function (args) {
// Use it to keep track of the selected date externally
console.log('onSelectedDateChange', args);
},
});
mobiscroll.getJson(
'https://trial.mobiscroll.com/events/?vers=5',
function (events) {
inst.setEvents(events);
},
'jsonp',
);
<div id="demo-event-hooks"></div>