Load dhtmlxScheduler data from the server not working

I am new to Scheduler and am trying to load data from the server using php, mysql and schedulerConnector but am running into issues.

I successfully load the scheduler into my layout and can move through adding/editing/deleting fake events from the screen, but my data from the server never loads and on page refresh, a blank alert modal displays. I am using a test table built solely for testing server data retrieval. I’m also not getting any errors when inspecting the page.

Client-Side:

script:

	sTabs = '<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>'+
            '<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>'+
            '<div class="dhx_cal_tab" name="month_tab" style="right:280px;"></div>';
	
		dhxScheduler = dhxLayout.cells("b").attachScheduler(new Date(), "month", sTabs);
		
		dhxScheduler.load("production_manager_sched_GET.php");
		dp = new dataProcessor("production_manager_sched_UPDATE.php");
		dp.init(dhxScheduler);

HTML:

	<div id="schedulerView" class="dhx_cal_container" style='width:100%; height:100%;'>
		<div class="dhx_cal_navline">
			<div class="dhx_cal_prev_button">&nbsp;</div>
			<div class="dhx_cal_next_button">&nbsp;</div>
			<div class="dhx_cal_today_button"></div>
			<div class="dhx_cal_date"></div>
			<div class="dhx_cal_tab" name="day_tab" style="right:204px;"></div>
			<div class="dhx_cal_tab" name="week_tab" style="right:140px;"></div>
			<div class="dhx_cal_tab" name="month_tab" style="right:76px;"></div>
		</div>
    	<div class="dhx_cal_header"></div>
    	<div class="dhx_cal_data"></div>       
	</div>

Server-Side:


<?php

	include("../modules/bms/dhtmlxScheduler_v4.4.0/codebase/connector/scheduler_connector.php");
	include("../modules/bms/dhtmlxScheduler_v4.4.0/codebase/connector/db_mysqli.php");

	include('inc.php');

	$conn = mysqli_connect($servername, $username, $password, $dbname);
	$schedulerConn = new schedulerConnector($conn, "MySQLi");//connector initialization

	$schedulerConn->render_table("prod_manager_sched", "id", "startdate", "enddate");

 	mysqli_close($conn);

?>

I can successfully load a test event in from a test xml doc but can not load from the server. Can anyone please post a reply? It would be greatly appreciated.

testXML.xml page (this works just fine: dhxScheduler.load(“testXML.xml”, “xml”); )

<?xml version="1.0" encoding="utf-8"?>


<data>
	<event id="1">
		<start_date>2017-04-25 02:30:00</start_date>
		<end_date>2017-04-25 03:30:00</end_date>
		<text>test</text>
		<type>some type</type>
	</event>
	<event id="2">
		<start_date>2017-04-15 02:30:00</start_date>
		<end_date>2017-04-15 03:30:00</end_date>
		<text>hi</text>
		<type>A</type>
	</event>
</data>

Could it be an issue because the scheduler is attached to a layout?

Hello,
seems like you have a line break before the opening <?php in server side handler. This line break goes to http response and breaks the output by causing some php warnings or notices. All should start working as expected if you remove that empty line at the beginning of php handler

Thank you for the reply. However, after removing the blank space, I am still experiencing the same behavior…

I’ve gone through and removed other included files (menu on the page, etc so it contains the bare minimum. After doing so, the alert I get now contains the xml returned by the connector. It appears to have an update action in the first set of xml tags and then gives a second set of xml tags that contain the proper data. Any idea as to why that is? A screen shot of the response is below:


and, I added the code to update/insert an event from the table. Upon saving the event, it gives an alert containing the xml and then I can see the event added to my table in the database. But, upon refresh of the page, I still cannot get any events to load in the scheduler…