onBeforeViewChange
Description
Fires before the user changes the current view to some other one
onBeforeViewChange: (old_mode: string, old_date: Date, mode: string, date: Date) => boolean
Parameters
old_mode- (required) string - the currently active viewold_date- (required) Date - the currently active datemode- (required) string - the new viewdate- (required) Date - the new date
Returns
result- (boolean) - defines whether the default action of the event will be triggered (true) or canceled (false)
Example
scheduler.attachEvent("onBeforeViewChange", (old_mode, old_date, mode, date) => {
// any custom logic here
return true;
});
Related samples
Details
- The event is blockable. Return
false, and the Scheduler will leave the current view open. - The event also fires when the Scheduler is initially rendered on the page. In this case, the
old_modeandold_dateparameters are undefined.
Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.