Is it possible to create several templates for a week, and then use these to fill the upcoming week?
you can have several functions for templates and switch them on onBeforeViewChange event(it’s triggers on opening and scrolling views)
docs.dhtmlx.com/doku.php?id=dhtm … viewchange
Or a single function, which checks current mode inside of it ( scheduler.getState API ) and based on its value executes different logic.
I am not sure I understand. Let’s say I have a week in the past, and I want to copy all the events from that week to a week in the future and preserve the old data. Is there an easy way to do this, or to set up several week templates elsewhere, and then load them?
Sorry, I was confused by used term - “template”, as scheduler has templates which can be used to redefine event appearance, not for defining some preset of events.
You can
a) use scheduler.getEvents to get array of events object for old date
b) look through such object, and for which one call addDate, passing the new object which will take necessary properties from old one.
It will allow to copy events from one time but another ( it is not a built-in functionality, just a public API usage )