onBeforeViewChange
Description
Fires before the user changes the current view to some other one
onBeforeViewChange: (old_mode: string, old_date: object, mode: string, date: object) => boolean
Parameters
old_mode- (required) string - the currently active viewold_date- (required) object - the currently active datemode- (required) string - the new viewdate- (required) object - 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", function(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 opened.
- The event also fires when the scheduler is initially being rendered on the page. In this case, the old_mode and old_date parameters are underfined.
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.