Hi, I want to display only on the gantt a task and his children for example I have this structure of table (task.png) and I want to display the project 1 and child 1, I tried this attempt but it didn’t work and I didn’t have any error in the console.Thanks.
JSONGanttConnector gantt = new JSONGanttConnector(conn, DBType.MySQL);
gantt.servlet(req, res);
gantt.mix("open", "1");
gantt.enable_order(“sortorder”);
gantt.render_links(“gantt_links”, “id”, “source,target,type”);
gantt.render_sql(“select * from task where id=1 and id=2”,“id”, “start_date,duration,text,progress,sortorder,parent”);[/code]
Hi,
please clarify the scenario.
Do you store a several projects in a database that should be displayed separately (so the case is not limited by a project and it’s first-level childs) ?
If so, you need to add an additional column like project_id which will store id of the root item for each project. Then you’ll be able to select required ones using a simple WHERE condition
Sorry, I think you are not understand what I want, if I have project which it has many children, for example a project with 10 children, how can I display only the project and it’s children ?
Hi,
I believe that is what i’ve described in my first reply:)
You need to add an additional column e.g. ‘project_id’, which will store the id of a root task (‘parent’ stores only a direct parent, and can’t be used for this task).
Each time new task is created, you can assign a project id value to it. For example by using onTaskCreated event docs.dhtmlx.com/gantt/api__gantt … event.html
When it’s done, you’ll be able selecting a separate project by a ‘project_id’ in a WHERE part of connector query
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan