Hello DHTMLX Team,
I am trying to add a deadline to my Lightbox. It is independent from the end_date:
gantt.config.lightbox.sections = [
{name:"description", height:38, map_to:"text", type:"textarea",focus:true},
[b] {name:"deadline", height:20, map_to:"auto", type:"time", single_date:true, time_format:["%d", "%m", "%Y"]},[/b]
{name:"time", height:72, map_to:"auto", type:"duration"}
];
gantt.locale.labels.section_deadline = "Deadline";
It is shown in the Lightbox correctly. But it does not chance the Value in my MySQL DB correctly. The POST message after saving the Lightbox seems strange too:
Parametersapplication/x-www-form-urlencoded
7_!nativeeditor_status updated
[b]7_deadline [Object object][/b]
7_duration 3
7_end_date 2013-04-23
If I change the “map_to” Parameter in the Lightbox to map_to:“deadline”, just a zero Date is shown in the POST message:
Parametersapplication/x-www-form-urlencoded
7_!nativeeditor_status updated
[b]7_deadline 0000-00-00 00:00:00[/b]
7_duration 3
7_end_date 2013-04-23
The SQL column has the Datatype of DATETIME (same as start_date). To connect to the DB I use this “data.php” File:
[code]<?php
include(‘codebase/connector/gantt_connector.php’);
include(‘codebase/connector/db_mysqli.php’);
$res=mysql_connect(“localhost”,“root”,"");
mysql_select_db(“gantt”);
$dbType = “MySQL”;
$gantt = new JSONGanttConnector($res, $dbType);
$gantt->mix(“open”, 1); //Opens all the treenodes. Does not need “open” ind render_table()
$gantt->render_links(“gantt_links”,“id”,“source,target,type”);
$gantt->render_table(
“gantt_tasks”,
“id”,
“start_date,duration,text,progress,sortorder,parent,deadline”
);
?>[/code]
What am I doing wrong? Can anyone help me?
Grettings,
Thomas