I am trying to get data from a MySQL view into dhtmlxScheduler. I have tried two approaches and neither works. When I try to use the render_table function and browse directly to my connector.php (called datasched.php in my case) I see my array of data returned as expected but three of the four fields are wrapped in CDATA tags. Apparently XML just ignores the contents of these tags so I get no data in dhtmlxScheduler. When I use the render_sql function I get the same results - fields wrapped in CDATA tags.
The interesting thing is that I have tried the exact same render_sql statement using the same MySQL table with dhtmlxGantt and everything works perfectly. The data is returned without CDATA tags and is displayed as expected in dhtmlxGantt. (Actually, I would prefer to use dhtmlxGantt but I need to display multiple independent tasks on one line.)
So, why can’t I get dhtmlxScheduler to work with my data just like dhtmlxGantt does? What do I need to do differently?
Do you have CDATA wrapped text directly in DB or as result of connector ?
In second case - that is perfectly fine, and must be processed by client side code correctly.
If issue still occurs for you - please provide a sample of problematic data.
Also, both Scheduler and Gantt supports loading from json, and both have related json connector classes - so you can try to use json instead of XML
It looks as a data generated by SchedulerConnector, for gantt you need to use GanttConnector.
While in above XML data tag named “event” in case of gantt connector it will be “task”
Sorry for any confusion but I am trying to display data in Scheduler. (I am using two connector files which are different. I call gantt_connector which allows me to connect and display data in Gantt and works perfectly. And yes, my Gantt connector produces
task id = "1"
. When I call schedule_connector Scheduler does not display anything but based on your response it appears to be setup correctly.) According to your last answer, the XML file that I reference in this thread which shows
event id = "1"
is setup correctly to display in Scheduler. So why doesn’t Scheduler display anything?
Browser can add some whitespaces and new lines while checking XML in browser ( if you check source of such xml page - it must show correct data without whitespaces )
The issue was not with the data but was due to a careless configuration error. I had an extra space in the y_property id name. Everything worked immediately as soon as the space was removed. I had set y_property: "id ", and then corrected it to read y_property: “id”,
Thanks again for your help and a great product!
John
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan