Lightbox: Adding second type:"time"

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:


$dbType = “MySQL”;

$gantt = new JSONGanttConnector($res, $dbType);
$gantt->mix(“open”, 1); //Opens all the treenodes. Does not need “open” ind render_table()

What am I doing wrong? Can anyone help me?


it seems that due to implementation, the time control is always mapped to start_date and end_date properties. So most probably, if you place several time controls in the lightbox, they will give not expected side-effects. The possible solution is to implement custom time control for the dates … ditor.html

As for the values you currently get 7_deadline [Object object]
The return value (one that assigned to the property specified in ‘map_to’) is an object, containing related dates:{ start_date: new Date(....), end_date: new Date(....) }
If you still be using built-in controls for a deadlines, you can serialize this values manually before sending data to server … foreupdate

Isn’t there a simpler way of mapping the “time” component to a different column than start_date/end_date?

No other way than either serializing the data manually or writing my own date component?