On the issue of mouse movement background color

I am using dhtmlxGantt v.7.0.11 Professional

I am trying to create a feature that adds background color to the task line by moving the mouse, including the grid area and timeline area.

I first tried the official provided example and made some modifications, as shown in the link below.
http://snippet.dhtmlx.com/5/46c094c26

When setting a task as a milestone without time, such as Task # 4.2 and Task # 2.4, the Gantt set_ Task_ The row background color becomes invalid.
But milestones with time, such as the Mediate milestone, are effective.

Another question
Task # 4.1 does not have a time, but it is displayed in the timeline area for one day. Can it be avoided?
And the display of Task # 4 does not include the scope of Task # 4.1, only calculating the time of the Mediate milestone

There is also a requirement consultation
If I want to make the row and column of the cell where the mouse is located display background color when I move the mouse over the timeline area, is there any good method to achieve this?

Looking forward to your reply very much, thank you

Hello,

When setting a task as a milestone without time, such as Task # 4.2 and Task # 2.4, the Gantt set_ Task_ The row background color becomes invalid.

Each regular task should have at least 2 date parameters: start_date, end_date, duration:
https://docs.dhtmlx.com/gantt/desktop__task_properties.html#requiredproperties

When a regular task doesn’t have those parameters, it should be unscheduled:
https://docs.dhtmlx.com/gantt/desktop__unscheduled_tasks.html

Project tasks ignore the date parameters, so they can be loaded without those parameters:
http://snippet.dhtmlx.com/dd3973ee5

If you load tasks without enough date parameters Gantt will assign them from their children or from other tasks. But in that case, you won’t be able to drag or resize these tasks.
You can check how it works in the following sample:
https://snippet.dhtmlx.com/wpxeeiap

It seems that when the task date is not valid, Gantt calls the task_row_class template for the parent task. So, when the mouse is over the #2.4 and #4.2 tasks, the template is called for their parent tasks. This is not a bug as Gantt expects the date parameters for all tasks.

If you unschedule the tasks with the incorrect dates, the template will be called correctly for these tasks.
Here is the updated snippet:
http://snippet.dhtmlx.com/5/73fbe21dd


Another question
Task # 4.1 does not have a time, but it is displayed in the timeline area for one day. Can it be avoided?
And the display of Task # 4 does not include the scope of Task # 4.1, only calculating the time of the Mediate milestone

Task #4 is a regular task. As it is said before, the dates are obtained from other tasks. If you drag Mediate milestone, Task #4 will follow it. You will need to unschedule the task, then it won’t be displayed in the timeline.


There is also a requirement consultation
If I want to make the row and column of the cell where the mouse is located display background color when I move the mouse over the timeline area, is there any good method to achieve this?

You will need to check the task row element and obtain the task ID there.
Here is the example of the implementation:

Hey, bro, thank you very much for your timely answer. Unschedule is a great help, making my charts no longer just hidden in CSS. I will study your response carefully and modify the code. If there are any questions, I will consult again.