how to insert project_id in to gantt_task table

Hello, I am developing with dhtmlxgantt using Laravel 5.2 and I need working with multiple projects in my app. so I need insert project_id regarding with each projects to gantt_task table. when I select a project my url contain like this “localhost:8000/project/6” so, as in this example project id 6 insert to gantt_task table as a new columns. and need render data when I select a each projects. can you give me a solutions.

Thanks.

Hello,
after you add a ‘project_id’ column to the gantt_task table, it should be quite simple.
Assuming client-side knows the current project id, then you need

  1. assign project id to all new tasks that created by user
  2. pass project id into the ajax loading

Here is how it can be done:
client side:

[code]// assign project id to newly created tasks, project id is available globally
gantt.attachEvent(“onTaskCreated”, function(task){
task.project_id = PROJECT_ID;
return true;
});


// pass project id to the backend in order to select required data
gantt.load(“project/” + PROJECT_ID);[/code]
docs.dhtmlx.com/gantt/api__gantt … event.html

server side:
if you use dhtmlxConnectors, you can use built-in filtering: $connector->filter("project_id", $project_id);
docs.dhtmlx.com/connector__php__filtration.html

Or filter data manually using the project id parameter from the request url