Skip to main content

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 view
  • old_date - (required) object - the currently active date
  • mode - (required) string - the new view
  • date - (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;
});

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.