To load events to the scheduler you should use either the method load() or the method parse():
$$("scheduler_id").load("data/events.xml","xml"); //or $$("scheduler_id").parse([ { id:1, start_date:"2009-7-1 6:00", end_date:"2009-7-1 8:00", text:"Event 1"}, { id:2, start_date:"2009-7-2 6:00", end_date:"2009-7-2 8:00", text:"Event 2"} ],"json");
The method load() takes 2 parameters and loads data from some external URL:
The method parse() also takes 2 parameters but loads data from a data object:
Related sample: samples/01_basic/01_init.html
The mandatory data fields:
The optional data fields:
[ { id:1, start_date:"2011-05-24 00:00:00", end_date:"2011-06-08 00:00:00", text:"French Open", details:"Philippe-Chatrier Court Paris, FRA" }, { id:2, start_date:"2011-06-10 00:00:00", end_date:"2011-06-13 00:00:00", text:"Aegon Championship", details:"The Queens Club London, ENG" } ]
<data> <item id="1"> <start_date>2011-05-24 00:00:00</start_date> <end_date>2011-06-08 00:00:00</end_date> <text>French Open</text> <details>Philippe-Chatrier Court Paris, FRA</details> </item> ... </data>
<data> <event id="1"> <start_date>2011-05-24 00:00:00</start_date> <end_date>2011-06-08 00:00:00</end_date> <text>French Open</text> <details>Philippe-Chatrier Court Paris, FRA</details> </event> ... </data>
The mobile scheduler lets you to save data back to DB: during initialization of the scheduler you should specify the appropriate server file in the parameter 'save' of the object constructor.
dhx.ready(function(){ dhx.ui({ view: "scheduler", id: "scheduler", save: "php/events.php" }); $$("scheduler").load("php/events.php","scheduler"); });
If you use dhtmlxConnector, the path to its file can be set as this parameter. In this case, dhtmlxConnector will do all the server work.
Related sample: samples/01_basic/05_data_saving.html