Timeline -> scheduler.parse(data, "json") not working

Hi,

We are using the scheduler timeline view, but we seem to be unable to load/parse data correctly.
This is our code for fetching the data:

function loadData() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { console.log(this.responseText); scheduler.parse(this.responseText, "json"); } }; xhttp.open("GET", [oururl], true); xhttp.send(); }

Below is the JSON we try to parse (printed in console from the above snippet). No data is rendered, but we do not see any errors :frowning:
We can see that the timeline_cell_class(evs, date, section) are not being called. Seems like nothing is happening after calling scheduler.parse()
We have also tried using scheduler.load(url, “json”) with the same results.

{ "data":[ { "id":450, "projectId":35, "text":"Odio molestiae iste quasi quis omnis id.", "start_date":"02/19/2017 06:55", "end_date":"11/04/2017 04:04", "employee_id":"1", "hours":20.9, "hoursFirstWeek":12.8, "hoursLastWeek":13.5, "hourPrice":717.87 } ], "collections":{ "developers":[ { "key":"devs", "label":"Developers", "open":true, "children":[ { "key":"1", "label":"Kyla Shields DVM", "defaultWorktime":36.0, "workHours":[ { "start_date":"01/06/2017 09:51", "end_date":"01/06/2017 09:51", "hours":0.0, "note":"Ratione porro velit facilis ex non." }, { "start_date":"09/09/2016 11:04", "end_date":"09/09/2016 11:04", "hours":0.0, "note":"Rem sed quis ab." }, { "start_date":"07/13/2016 01:56", "end_date":"07/13/2016 01:56", "hours":0.0, "note":"Harum est cumque quae." }, { "start_date":"06/02/2016 08:31", "end_date":"06/02/2016 08:31", "hours":0.0, "note":"Molestiae recusandae ipsam nam omnis aut dolorem." }, { "start_date":"06/09/2016 07:09", "end_date":"06/09/2016 07:09", "hours":0.0, "note":"Vero est itaque eaque minus delectus perferendis." }, { "start_date":"10/15/2016 01:01", "end_date":"10/15/2016 01:01", "hours":0.0, "note":"Et qui porro et maxime molestias ut." }, { "start_date":"12/29/2016 05:10", "end_date":"12/29/2016 05:10", "hours":0.0, "note":"Sed facere expedita voluptas numquam." }, { "start_date":"12/06/2016 10:17", "end_date":"12/06/2016 10:17", "hours":0.0, "note":"Aliquam quia aut dolore enim ullam aspernatur praesentium unde ut." }, { "start_date":"09/13/2016 09:55", "end_date":"09/13/2016 09:55", "hours":0.0, "note":"Omnis qui velit voluptatibus aut beatae sunt iure." } ], "bookedDictionary":{ "2015-21":12.8, "2015-45":13.5, "2015-22":20.9, "2015-23":20.9, "2015-24":20.9, "2015-25":20.9, "2015-26":20.9, "2015-27":20.9, "2015-28":20.9, "2015-29":20.9, "2015-30":20.9, "2015-31":20.9, "2015-32":20.9, "2015-33":20.9, "2015-34":20.9, "2015-35":20.9, "2015-36":20.9, "2015-37":20.9, "2015-38":20.9, "2015-39":20.9, "2015-40":20.9, "2015-41":20.9, "2015-42":20.9, "2015-43":20.9, "2015-44":20.9 } } ] } ] } }

Hi,
i’ve copied your json and added it into 01_initialization_loading/01_basic_init.html example,
everything seems working as expected:
event and scheduler initialization code screencast.com/t/qzhNWoH8jp6Y
serverList collection screencast.com/t/NvshSNj3jt

There are two things that could go wrong

  1. please make sure that the xml_date format matches format used in your datafeed. Scheduler uses “MM-dd-YYYY” (which is used in your json) by default, that’s why scheduler.config.xml_date is commented out. You can set it explicitly using following code:

scheduler.config.xml_date = "%m/%d/%Y %H:%i";
2) server list must be initialized/declared before it’s loaded from the dataset. We’ll probably fix it in next update, but currently you have to call server list at least once in order it to be populated, this is why there is “scheduler.serverList(“developers”);” call