Events show but then disappear when loading data from multip

When loading event data from multiple json sources, events will display but then will quickly disappear at random. This only occurs when loading many events (400+) from 3 or more data sources. Sometimes they will all display correctly, but most of the time the majority of them disappear.

Note: Many of the events are more than a year long.

Example using the multiple source extension:

  scheduler.load(["data1.json", "data2.json", "data3.json"], "json");

I am suspicious that the events are being filtered after initialisation but can’t find out why. This happens on all views.

Please help!

Hello,
probably this is happening because of collision of ids between the items from different data sources. When scheduler loads an item which has the same id as one of already existing items - it assumes it is the same data item, the old one is getting replaced.

You can try adding a prefix to ids depending on data source, in order to prevent collisions

That fixed the problem. Thanks very much.

hey,

how we can load multiple data with different type, like:

scheduler.load([“data1.json”, “data2.ical”], “json”, “ical”);

thank you

You can use something like follows

scheduler.load("data1.json","json", function(){ scheduler.load("data2.ical", "ical"); });

thank you it works :wink:

Hello guys

I still have the Problem above. I’m loading data from 3 data Sources:

scheduler.load(["../../../dhtmlx/Scheduler/php/events.php?id=1","../../../dhtmlx/Scheduler/php/events.php?id=2","../../../dhtmlx/Scheduler/php/events.php?id=3"]);

The first dataset loads well but in the second and third are randomly missing events. I changed table ids so there are no collision with the IDs.

events.php

if($_GET['id'] == "1") {
    $scheduler = new SchedulerConnector($db,"MySQLi");'
    $scheduler->render_table("termine","termin_id","termin_start,termin_end,termin_text,termin_typ,termin_user");
}

if($_GET['id'] == "2") {
    $scheduler = new SchedulerConnector($db,"MySQLi");
    $scheduler->render_sql("SELECT CONCAT(YEAR(CURDATE()),'-',LPAD(MONTH(benu_bday),2,'0'),'-',LPAD(DAY(benu_bday),2,'0'),' 00:00:00') AS termin_start,CONCAT(YEAR(CURDATE() + INTERVAL 1 DAY),'-',LPAD(MONTH(benu_bday + INTERVAL 1 DAY),2,'0'),'-',LPAD(DAY(benu_bday + INTERVAL 1 DAY),2,'0'),' 00:00:00') AS termin_end, '' AS termin_text, benu_id AS termin_user, '9' AS termin_typ FROM benutzer WHERE benu_bday <> '0000-00-00' AND benu_shop = '".$_SESSION["user_shop"]."'", "benu_id", "termin_start, termin_end, termin_text, termin_user, termin_typ");
}

if($_GET['id'] == "3") {
    $scheduler = new SchedulerConnector($db,"MySQLi");
    $scheduler->render_sql("SELECT CONCAT(stamm_kaufdatum,' 00:00:00') AS termin_start,CONCAT(stamm_kaufdatum + INTERVAL 1 DAY,' 00:00:00') AS termin_end, stamm_objekt AS termin_text, '1' AS termin_user, '1' AS termin_typ, stamm_intern AS termin_intern, stamm_objekt AS termin_objekt FROM stammdaten WHERE stamm_shop = '".$_SESSION["user_shop"]."'", "stamm_id", "termin_start, termin_end, termin_text, termin_user, termin_typ, termin_intern, termin_objekt");
}

id=1 -> Events
id=2 -> I would like to load birthdays from User-Table
id=3 -> I would like to load all the finished orders

Would be great if someone can help me with this. Maybe i’m doing something wrong or someone has another and better idea.

Thank you
Oliver

Please, try to enable the connector logging
https://docs.dhtmlx.com/connector__php__errors.html
e.g.

$scheduler = new SchedulerConnector($db,"MySQLi");
$scheduler->enable_log("table1_log.txt");

and check how the log looks like after you try loading the data? are there any sql errors?

Also, you can check the server output and see whether it looks as expected:

And lastly, you can check how the data looks like inside the scheduler on the page. In order to do so you can execute scheduler._events in the browser console


it’ll output the internal object where scheduler stores all loaded events - there you can check whether some events are missing from that object, or, if there are actually loaded to the scheduler but not displayed - you’ll be able to inspect their properties and see what’s wrong with them. Usually, it’s incorrect date format and you’ll have events with obviously wrong dates, e.g. 1930s.

one of these steps should give you a clue on what’s going wrong