How to display Leaves?

Hello,
I want to display leaves for particular user. (Suppose, Admin take leave on 19, 27 to 28)
For leaves i created project named “Leaves” with it’s tasks as leaves (1st task with duration 19 to 19, 2nd task with duration 27 to 28)

Now, I don’t want to create project and tasks for leaves and want to display leaves how it’s possible?
I knew about addTaskLayer(docs.dhtmlx.com/gantt/api__gantt … layer.html)

How can i done with addTaskLayer?


Hello,

You can create array with start and end dates of leaves and display leaves according to these dates:
docs.dhtmlx.com/gantt/snippet/de5372df

Thanks :slight_smile: , Polina

Hi!, the above provided snippet link is not working anymore :neutral_face:

I want display leaves on for each particular task, how can I have this feature?
How can it be implemented?
is that possible with passing a property in the data like this…

{
“id”: “2”,
“parent”: “1”,
“task_no”: “190-SERVICECHECK-HM”,
“text”: “THIS TASK CARD IS FOR INFORMATION ONLY”,
“zone”: “FUSE”,
“phase”: “INUCTION”,
“assignee”: [
{ “name”: “Jone” }
],
“man_hours”: 5.0,
“duration”: 10,
“trade”: “Leading Hand”,
“sequence”: 1,
“start_date”: “2024-01-01 14:00:00”,
“end_date”: “2024-01-05 05:00:00”,
“deadline”: “2024-01-01 23:00:00”,
“leaves”:[ “2024-01-02”, “2024-01-03”],
“status”: “Closed”,
“progress”: 1,
“type”: “task”
},

Hello Prakash,
Unfortunately, the old snippet tool is not available, so there is no way to restore the old solution.

In the current Gantt version (8.0.6), you can use the rollup functionality, and the child tasks will be displayed on the parent tasks:
https://docs.dhtmlx.com/gantt/desktop__milestones.html#rolluptasksandmilestones

Here is an example:
https://snippet.dhtmlx.com/yhak8gb6