I need to visualize task and milestones which are available in same table in the database.
How to do this?
Hi,
please clarify what you’ve tried to do, and what has gone wrong.
Milestones can be loaded the same way as regular tasks. Make sure your records have ‘type’ field, and that the field is loaded from the server
docs.dhtmlx.com/gantt/desktop__loading.html
i have stored activities for the project in a table with id, start date, duration,parent id, etc. But with no “type” field.
Now i want to add milestones to the project.
I need to store milestone data in same table with “type” field as you said.
So how type field has to be entered for activities and milestones?
and how it can be inserted in render_table statement?
eg:
$gantt->render_table(
“tbl_gantt”,
“id”,
“start_date,duration,text,progress,sortorder,parent,type”);
please assist.
You can simply add a column type
- by default it might be a varchar. with empty or “task” values for a regular tasks, and “milestone” and “project” for milestones and projects respectively. You can also redefine configuration in order to store numeric values of types, instead of full strings. However, this is optional.
docs.dhtmlx.com/gantt/desktop__loading.html
docs.dhtmlx.com/gantt/api__gantt … onfig.html
After you add the column and specify default values, the connector code from your post should be enough to load milestones to the gantt
The problem are this, and is tested with your demo: docs.dhtmlx.com/gantt/samples/0 … _type.html
In your demo appears like:
{“id”:11, “text”:“Project #1”, type:gantt.config.types.project, “progress”: 0.6, “open”: true},
But server reply with something like this:
{“id”:11, “text”:“Project #1”, “type”:“project”, “progress”: 0.6, “open”: true},
when type was with quotes, it doesn’t work any more.
I try it and it doesn’t work:
- The connector:
$gantt->render_table("expedientes_gantt_tasks","id","start_date,end_date,text,progress,parent,deadline,planned_start,planned_end,sortorder,type,details,users,priority,open,deep,id_expediente","");
- The server reply:
{
"data":[
{
"id":"86",
"start_date":"2017-05-10",
"end_date":"2017-05-17",
"text":"Tarea #2.2",
"progress":"0.88",
"parent":"83",
"deadline":"2017-05-18",
"planned_start":"2017-05-18",
"planned_end":"2017-05-19",
"sortorder":"0",
"type":"project",
"details":"",
"users":"1",
"priority":"3",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"87",
"start_date":"2017-05-11",
"end_date":"2017-05-16",
"text":"Tarea #2.2.1",
"progress":"0.88",
"parent":"86",
"deadline":"2017-05-18",
"planned_start":"2017-05-18",
"planned_end":"2017-05-19",
"sortorder":"0",
"type":"task",
"details":"",
"users":"1",
"priority":"3",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"88",
"start_date":"2017-05-08",
"end_date":"2017-05-17",
"text":"#1",
"progress":"0.71",
"parent":"82",
"deadline":"2017-05-20",
"planned_start":"2017-05-04",
"planned_end":"2017-05-19",
"sortorder":"0",
"type":"project",
"details":"",
"users":"1",
"priority":"2",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"89",
"start_date":"2017-05-09",
"end_date":"2017-05-12",
"text":"Tarea #1.2",
"progress":"0.9",
"parent":"88",
"deadline":"2017-05-15",
"planned_start":"2017-05-08",
"planned_end":"2017-05-15",
"sortorder":"0",
"type":"project",
"details":"",
"users":"1",
"priority":"3",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"90",
"start_date":"2017-05-12",
"end_date":"2017-05-18",
"text":"Tarea #1.4",
"progress":"0.9",
"parent":"89",
"deadline":"2017-05-18",
"planned_start":"2017-05-11",
"planned_end":"2017-05-17",
"sortorder":"0",
"type":"task",
"details":"",
"users":"1",
"priority":"2",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"91",
"start_date":"2017-05-11",
"end_date":"2017-05-16",
"text":"Tarea #1.3",
"progress":"1",
"parent":"88",
"deadline":"2017-05-17",
"planned_start":"2017-05-11",
"planned_end":"2017-05-19",
"sortorder":"0",
"type":"task",
"details":"",
"users":"1",
"priority":"3",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"92",
"start_date":"2017-05-15",
"end_date":"2017-05-20",
"text":"Tarea #2.3",
"progress":"0.34",
"parent":"83",
"deadline":"2017-05-18",
"planned_start":"2017-05-13",
"planned_end":"2017-05-19",
"sortorder":"0",
"type":"task",
"details":"",
"users":"1",
"priority":"2",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"93",
"start_date":"2017-05-24",
"end_date":"2017-05-25",
"text":"Tarea #3.1",
"progress":"0",
"parent":"85",
"deadline":"2017-05-25",
"planned_start":"2017-05-24",
"planned_end":"2017-05-26",
"sortorder":"0",
"type":"task",
"details":"",
"users":"1",
"priority":"0",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"94",
"start_date":"2017-05-15",
"end_date":"2017-05-23",
"text":"Tarea #1.1",
"progress":"0.45",
"parent":"88",
"deadline":"2017-05-24",
"planned_start":"2017-05-14",
"planned_end":"2017-05-25",
"sortorder":"0",
"type":"task",
"details":"Por fin!",
"users":"1",
"priority":"1",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"82",
"start_date":"2017-05-05",
"end_date":"2017-05-25",
"text":"P1",
"progress":"0.6274468085106383",
"parent":"0",
"deadline":"2017-06-01",
"planned_start":"2017-05-01",
"planned_end":"2017-05-31",
"sortorder":"1",
"type":"project",
"details":"Descripcion P1",
"users":"1",
"priority":"2",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"83",
"start_date":"2017-05-08",
"end_date":"2017-05-17",
"text":"#2",
"progress":"0.54",
"parent":"82",
"deadline":"2017-05-18",
"planned_start":"2017-05-08",
"planned_end":"2017-05-19",
"sortorder":"2",
"type":"project",
"details":"Descripcion T2",
"users":"1",
"priority":"1",
"open":1,
"deep":1,
"id_expediente":"1"
},
{
"id":"85",
"start_date":"2017-05-18",
"end_date":"2017-05-23",
"text":"#3",
"progress":"0",
"parent":"82",
"deadline":"2017-05-23",
"planned_start":"2017-05-17",
"planned_end":"2017-05-24",
"sortorder":"3",
"type":"project",
"details":"Descripcion T1",
"users":"1",
"priority":"0",
"open":1,
"deep":1,
"id_expediente":"1"
}
],
"collections":{
"links":[
{
"id":"1",
"source":"82",
"target":"88",
"type":"1"
},
{
"id":"2",
"source":"88",
"target":"89",
"type":"1"
},
{
"id":"3",
"source":"82",
"target":"83",
"type":"1"
},
{
"id":"4",
"source":"82",
"target":"85",
"type":"1"
},
{
"id":"5",
"source":"83",
"target":"86",
"type":"1"
},
{
"id":"7",
"source":"89",
"target":"90",
"type":"0"
},
{
"id":"8",
"source":"88",
"target":"91",
"type":"1"
},
{
"id":"9",
"source":"88",
"target":"94",
"type":"1"
},
{
"id":"10",
"source":"87",
"target":"86",
"type":"1"
},
{
"id":"11",
"source":"83",
"target":"92",
"type":"1"
},
{
"id":"13",
"source":"85",
"target":"93",
"type":"0"
},
{
"id":"14",
"source":"88",
"target":"90",
"type":"3"
},
{
"id":"15",
"source":"90",
"target":"94",
"type":"0"
}
]
}
}