Gantt Connector

Hi,

Is it possible to use Gantt with the Connector, so that data is coming from database?
If not, is there a workaround existing?

Is it possible to make the Gantt chart representing 24 hours instead of 8 hour workday?

Is it possible to attach Gantt to Layout, like so? It isn’t listed, but I want to ask anyway.
var timeline = dhxLayout.cells(“b”).attachGantt();
I cannot see any way to make the Gantt resize to match layout cell.

Also one user wrote:
pyleaf, 2010/09/27 03:39
1, why does the the period of the parenttask decide the last childtask? In fact, I think the relationship should be Converse, because parenttask is virtual but childtask real

And response is:
Support, 2010/10/14 05:57
We have encoded one of possible algorithms. As I understand, we should add the ability to disable it. We will plan it for the next version. Thank you for the comment.

I would like to know whether this option exists and how I may use it.
Thanks!

PS - Fyi, the sample XML on this page generates an error: docs.dhtmlx.com/doku.php?id=dhtm … g_xml_data

No, we do not have ready-to-use connector for the Gantt yet, you should use your own code to supply XML for the gantt. Basically it is very, very project specific.

Yes. In the current version you should manually fix the source code, line

this.hoursInDay = 8;

In the next version there will be a method setHoursInDay()
If you would like, please add it to the code as this:

GanttChart.prototype.setHoursInDay = function(hours) { if (hours<1 || hours>24) { alert("Invalid DayHours value. Must be within the range [1..24]."); return; } this.hoursInDay = hours; this.hourInPixelsWork = this.dayInPixels / this.hoursInDay; };
and call it before create().

Not yet. We are working on this, i will let you know here when we have it.

No, we have not yet implemented it.

To request these as features, should I repost in the other forum?

Can you give me a hint which technology I should use to generate my own XML from the database? Is this Ajax or Json or … something else? I will go learn it.

Thanks!
:slight_smile:

There is no need to repost, we got the idea from here :smiley:
Server-side is your choice, usually it’s PHP or ASPX, what type of connector are you using now?

I am using PHP.

I found a page with tutorial that I am studying now.
Kirupa has been a nice website for a long time:
kirupa.com/web/mysql_xml_php.htm

I think this way I can learn to make the XML file that is needed.

Am I correct to believe that Gantt chart does not support both date and time?

For example if I have field in in mySQL, with type “datetime”, then it formats as:
“2011-01-01 14:00:00”
Is this why my XML conversion is not working?
If so, may I suggest option to display in hours instead of days?

Instead of linking to xml file, I linked to this php file.
Of course I may have made other error:

<?php 
require_once('../connect/config.php');

header("Content-type: text/xml"); 

$linkID = mysql_connect($dbhost, $dbuser, $dbpass) or die("Could not connect to host."); 
mysql_select_db("isti_ab", $linkID) or die("Could not find database."); 

$query = "SELECT * FROM my_grid ORDER BY grid_id ASC"; 
$resultID = mysql_query($query, $linkID) or die("Data not found."); 
$completed = 100;

$xml_output = "<?xml version=\"1.0\"?>\n"; 
$xml_output .= "<projects>\n"; 
for($x = 0 ; $x < mysql_num_rows($resultID) ; $x++){ 
    $row = mysql_fetch_assoc($resultID); 
    $xml_output .= "\t<project\n"; 
    $xml_output .= "\t\t<task id='" . $row['grid_id'] . "'>" . "<name>" . $row['grid_name'] . "</name>\n"; 
	$xml_output .= "\t\t<est>" . $row['grid_starttime'] . "</est>\n"; 
	$xml_output .= "\t\t<dur>" . $row['grid_endtime'] . "</dur>\n"; 
	$xml_output .= "\t\t<percentcompleted>" . $row[$completed] . "</percentcompleted>\n"; 
	$xml_output .= "\t\t<predecessortasks>" . "</predecessortasks>\n"; 
	$xml_output .= "\t\t<childtasks>" . "</childtasks>\n"; 
	$xml_output .= "</task>\n"; 
    $xml_output .= "\t</project>\n"; 
} 
$xml_output .= "</projects>"; 
echo $xml_output; 
?> 

Please read the docs for XML format. Date format in XML is: 2010,12,14
It is year,month,day. There is no time part in it.

im using dhtmlxGantt 1.3, in this version still have the same problem, no connexion to database???

Hi,
Have you fix the bug for “DATA_ERROR Increase duration of parent task (2) or reduce EST of child task (4) or reduce duration of child task(4)” ?

Can you tell us approximately when will available the next version ?

5th of July, if it goes alright.

hello;
this version can retrieve data from a database?
thanks

DB is so project specific, it is not a part of control.

okey, so i still need to export my data from database into xml file to load GanttChart?

Kind of - you may directly out your XML back to client, no need to have a file.
So you point instead of data.xml to data.php and within this script you can print your xml data.

okey, but im using jee with jsf pages not php

it’s the same idea, use jsp or other kind of active server document.