DHTMLXGantt with CakePHP : Select only specific task

Hi all.

I manage to integrate DHTMLGantt with CakePHP, thanx to the community.

But now I’m having a problem on how to select only specific task.

My database is like this:

Task
[]taskid[/]
[]projectid[/]
[]taskname[/]
[]startdate[/]
[]duration[/]
and more

Now I want to select only the task with projectid of 1 for example. Where should i provide the conditions?

Right now, my code is like the following.

$connector = new JSONGanttConnector($this->Task, "PHPCake"); $connector->render_table("tasks", "taskid", "startdate, duration,taskname, progress,sortorder,parent");

Thanx in advance for the help.! :smiley:

If you need to use not all data but a subset, you can use result of find command instead of a model.

$connector = new JSONGanttConnector($this->Task->find(search_criteria), "PHPCake"); $connector->render_table("tasks", "taskid", "startdate, duration,taskname, progress,sortorder,parent");

And as you would with java connector?

In case of java connector ( as well as in case of raw php connector ) you can use render_sql command instead of render_table and provide the filtering criteria as part of SQL