Reputation: 997
I have downloaded dhmtlx event scheduler and able to successfully loaded data from MySQL DB. But I am not getting how to save event-related data into DB.
<script type="text/javascript" charset="utf-8">
function init() {
var sections=[
<?php
$data = "";
for($i=0; $i<count($employees);$i++){
$data.='{key:<?php echo $i?>, label:"<?php echo $employees[$i]?>"}'.",",
}
$data = substr($data,0,-1);
echo $data;?>
];
scheduler.locale.labels.unit_tab = "Unit"
scheduler.locale.labels.section_custom="Section";
scheduler.config.details_on_create=true;
scheduler.config.details_on_dblclick=true;
scheduler.config.lightbox.sections=[
{name:"description", height:50, map_to:"text", type:"textarea" , focus:true},
{name:"custom", height:30, type:"select", options:sections, map_to:"section_id" },
{name:"time", height:72, type:"time", map_to:"auto"}
]
scheduler.createUnitsView({
name:"unit",
property:"section_id",
list:sections,
size:10,
step:5
});
scheduler.config.multi_day = true;
scheduler.init('scheduler_here',new Date('<?php echo date('Y')?>','<?php echo date('m')?>','<?php echo date('d')?>'),"unit");
scheduler.load("./data/units.json");
}
</script>
But I am not able to figure out how to insert/ update data from the event popup. Any help would be greatly appreciated.
Upvotes: 0
Views: 757
Reputation: 412
The recommended approach to connect dhtmlxScheduler to a backend is to implement RESTful API on the server and use dhtmlxDataProcessor on the client. Please find a detailed guide in the dhtmlxScheduler documentation:
https://docs.dhtmlx.com/scheduler/server_integration.html
Upvotes: 1