Hi. I am really struggling with figuring out how to save custom fields back to the database using scheduler. I want to be able to add some custom fields to an event and then save those back to our database. I have been looking through the sample code but cannot figure it out. Hopefully someone can help. Here is the code I have so far:
Client Side Code:
[code]scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init(‘scheduler_here’,null,“month”);
scheduler.form_blocks["my_editor"] = {
render:function(sns) {
return "<div class='dhx_cal_ltext' style='height:60px;'>Text <input type='text'><br/>Details <input type='text'></div>";
},
set_value:function(node, value, ev) {
node.childNodes[1].value = value || "";
node.childNodes[4].value = ev.details || "";
},
get_value:function(node, ev) {
ev.details = node.childNodes[4].value;
return node.childNodes[1].value;
},
focus:function(node) {
var a = node.childNodes[1];
a.select();
a.focus();
}
};
scheduler.config.lightbox.sections = [
{ name:"description", height:200, map_to:"text", type:"my_editor" , focus:true},
{ name:"time", height:72, type:"time", map_to:"auto"}
];
scheduler.load("/calendar_connector.php", function() {
scheduler.showLightbox("1261150564");
});
var dp = new dataProcessor("/calendar_connector.php");
dp.init(scheduler);[/code]
Server Side Code:
[code]<?
require_once("…/calendar/codebase/connector/scheduler_connector.php");
$res=mysql_connect(“localhost”,“root”,"");
mysql_select_db(“ebiz”);
$conn = new SchedulerConnector($res);
$conn->enable_log("temp.log");
$conn->render_table("calendar_alerts","id","start_date,end_date,name,description");
?>[/code]
I would like the details input box to save into the description field in my database. What am I doing wrong?
Thanks,
Chris