Hide_bar property + baseline

Hello, not sure if it’s intended or if it’s a bug, but as you can see on this snippet :
https://snippet.dhtmlx.com/aygs4nkj
if you have a task with hide_bar = true, its baseline is still visible (but the task isn’t).

btw, is there a good method to put “” (empty string) as value for all columns in the grid when there is a hide_bar = true ? I know i can do it with the “template” attribute on each column but i wonder if there is a more global way

Hello,

Hello, not sure if it’s intended or if it’s a bug, but as you can see on this snippet :
DHTMLX Snippet Tool
if you have a task with hide_bar = true, its baseline is still visible (but the task isn’t).

The hide_bar property only hides the task bar itself. It doesn’t affect baselines, deadlines or any custom elements you may add to the task row. That config was added to keep the task row (for whatever reason) and hide the task bar that is rolled up to the parent tasks:
https://docs.dhtmlx.com/gantt/desktop__milestones.html#hidingtasksandmilestones

If you want to hide the baseline, there are many different ways to do that. Probably, the easiest way is to add a custom class name to the className property of the baseline object and add the display: none style rule:
https://snippet.dhtmlx.com/mwmg5l5r

You may notice that there is a space at the end of the custom class name. This is necessary for the milestone baselines because of a bug in Gantt. If you don’t add it, the baseline loses the diamond shape as the custom style is not applied correctly. It will be fixed in the future, but I cannot give you any ETA.


btw, is there a good method to put “” (empty string) as value for all columns in the grid when there is a hide_bar = true ? I know i can do it with the “template” attribute on each column but i wonder if there is a more global way

You can return a custom class name in the grid_row_class template:
https://docs.dhtmlx.com/gantt/api__gantt_grid_row_class_template.html

And you can use it as a selector along with the .gantt_tree_content class name to hide the content:

.hide_text .gantt_tree_content{
    display: none;
}

Here is the snippet:
https://snippet.dhtmlx.com/7s0if4w2

1 Like