Unscheduled tasks ( reserved spot )

Premium licence ( but i can’t add more than 1 attachment because i’m new user ) .
I am encountering a display issue with our Gantt chart implementation where certain tasks are not being displayed in the correct order as defined by their task_id. Instead, these tasks are erroneously positioned at the bottom of the Gantt chart. Our objective is to ensure that all tasks, including those without defined start and end dates (unscheduled tasks), are ordered correctly within the Gantt chart according to their task_id.

Detailed Problem:

  • The Gantt chart is intended to display tasks in an order specified by a task_id attribute. This task_id correlates with the sequence in which tasks should be displayed.
  • Tasks with scheduled start and end dates are displayed correctly. However, tasks without these dates (unscheduled tasks) are not being inserted into their proper place within the sequence.
  • Instead, unscheduled tasks are being shown at the end of the Gantt chart, as can be seen in the attached screenshot (Screenshot_8.png).
  • The second screenshot (image (1).png) shows the desired order of tasks with their respective task_id and other details.

Expected Behavior:

  • All tasks should be displayed in ascending order based on their task_id, regardless of whether they have scheduled dates , but not to brake the structure for defining the projects/childs etc.
  • Unscheduled tasks should be inserted at the correct index within the task sequence to maintain the logical order.

Please find the relevant data structure and code snippets attached, which may assist in diagnosing the issue.
( because i’m new user, ill upload the pictures via service , not directly here :

https://ibb.co/q9W9r0D
https://ibb.co/v3YxFxr

)

data.json (15.2 KB)

Hello Luis,
When you load the data, the order of tasks depends on their position in the JSON data. The unscheduled property shouldn’t be related to that.

If you have a specific property that stores the order of tasks, you can sort them after loading the data:
https://docs.dhtmlx.com/gantt/api__gantt_sort.html

Also, the task position depends on the parent task they are assigned to. It seems that in your case, the tasks without dates are located at the root level as they don’t have the parent parameter. So, it is expected that they are displayed below the Project1 task:


There is no way to put these tasks between other tasks unless you specify the correct value in the parent parameter.

Here is the snippet with the updated data:
https://snippet.dhtmlx.com/se3jo9az

You can also submit a support request to report bugs or ask the questions as the questions on the forum and below the documentation articles have lower priority.
You can find the support email in the letter with the license.