Hi,
I'm testing DayPilot Pro for JavaScript and it's great !
In my Scheduler (Row header), I would like to have :
- column 1 : name of project ("name" field in my MySQL datasource) --> It's OK
- column 2 : days of workloads planned for the project ("daysnb" field in my MySQL datasource) --> :(
For the second column, I haven't figured out a way of doing the map between my data and the innerHtml, in order to populate this column.
My code in "backend_project.php" :
...
$aMissionList = CMDBSource::QueryToArray($sMissionListSQL);
class Mission {}
$result = array();
foreach($aMissionList as $mission) {
$r = new Mission();
$r->id = $mission['id'];
$r->name = $mission['last'].' - '.$mission['first'];
$r->daysnb = $mission['days_nb'];
$result[] = $r;
}
header('Content-Type: application/json');
echo json_encode($result);
My code in "index.php" :
var projecturl = "backend_project.php?user=" + item.id;
dp.rows.load(projecturl, function (args) {
args.data.splice(0, 0, {id: "L" + item.id, name: item.name, daysnb: item.daysnb, type: "user"});
});
I don't know how to use the new parameter "item.daysnb" to display the value in the right column.
Can you help me ?
Regards,
Rafael.