Hello,
I am trying to get the values for the sections in the timeline view from my database. I have gone over the samples and the forum and I seem to be missing something. I can get it to return something from the database however it is in the wrong format and is not showing up in the schedule.
Here is my JS:
[code] var sections = scheduler.serverList(“sections”);
scheduler.createTimelineView({
name: "timeline",
x_unit: "minute",
x_date: "%H:%i",
x_step: 60,
x_size: 12,
x_start: 8,
x_length: 24,
y_unit: sections,
y_property: "ID",
render:"bar"
});
scheduler.init('scheduler_here', null, "timeline");
scheduler.load("/schedule/connector.php");
[/code]
And my PHP:
$options = new PWPSchedulerOptionsConnector();
$DataFields = "USRUsers.ID as ID, concat(PPLPeople.FirstName, ' ', PPLPeople.LastName) as label";
$SQL = "SELECT $DataFields from USRUsers JOIN PPLPeople on USRUsers.PPLPeople_ID = PPLPeople.ID where USRUsers.IsActive = 1";
$options->render_sql($SQL, "ID", "ID, label");
$scheduler->set_options("sections",$options);
The response from my server is:
{ "data":[], "collections": {"sections":[<item ID='1' label='jess b'><\/item>\n]}}
which doesn’t look right to me. How can I get it to show up along the side as the sections in timeline view? I need to be able to schedule tasks per employee. What am I missing? Any pointers would be greatly appreciated.
Thank you!