Sync with datastore

Hello to everybody,

I’m trying to syncronize multiple instances of scheduler with DataStore, as described here docs.dhtmlx.com/scheduler/multiple_per_page.html.

The problem is with the “sync” method on the scheduler object.

var events = [];
var datastore = new dhtmlXDataStore();
datastore.parse(events);
scheduler.sync(datastore, { copy:true });

When I try to call it, I get the following error, on javascript console:
“scheduler.sync is not a function”.

I checked the datastore object, and there are no problems with it. It is correctly initilialized.

What am I doing wrong?

I solved it.
The problem was that in my html page I was including dhtmlx.js before dhtmlxscheduler.js.

The correct order is first dhtmlxscheduler.js, then dhtmlx.js.