gantt.templates.grid_indent

I am new to using the Gantt and have the need to reset the indentation width in gird_ident function if the priority field has a certain value. How can I do this? Any suggestions?

Hi,
not sure I exactly understand your task.
If you want to remove visual indentation for certain tasks, not changing the hierarchy, you can define a css template task row.
docs.dhtmlx.com/gantt/api__gantt … plate.html
JS:gantt.templates.task_row_class=function(start, end, task){ if(task.priority == something) return "no_indent"; };
CSS:.no_indent .gantt_tree_indent{ display: none !important; }
If you mean that when users assigns a certain priority to the task element, it should be reassigned to the upper level of hierarchy (change the it’s direct parent element, so it’s previous parent will become it’s sibling task), then probably you could trace onTaskSave event and change the parent of the task

docs.dhtmlx.com/gantt/api__gantt … event.html

What I do is something like this:
Project # 1 … priority = 0
Task # 1 … priority = 0
Task # 2 … priority = 1
Task # 3 … priority = 2
Task # 4 … priority = 1

  • Note that they are at the same level - Father

When the priority is = 0, no indentation occurs.
A level of indentation when the priority is = 1 occurs.
Another level of indentation when the priority for = 2, occurs.
Project # 1 … priority = 0
Task # 1 … priority = 0
Task # 2 … priority = 1
Task # 3 … priority = 2
Task # 4 … priority = 1
We are evaluating the purchase of license of this product in our company, and informed the above feature would be something important in the definition of purchase.

You can put this into practice, and if possible how can I do?

Hi,
indention in tree is defined this template:
docs.dhtmlx.com/gantt/api__gantt … plate.html
and the related css setting:.gantt_tree_indent { width: 15px; }

The template can be overwriten. Inside the template you have access to the related task element, so you can modify the output appropriately.

Alternatively, you can define a several css classes with different indent widths, and assign the required one to the task using ‘grid_row_class’ template
docs.dhtmlx.com/gantt/api__gantt … plate.html