Show resources marks after selected task


I needed to show only the resource marks during the time of that selected task. It is possible?

Thank you.


Yes, it is possible to implement that. You can check the assigned tasks and show the markers only if the task is selected.
Here is the snippet with that functionality:
It has the additional functionality to show the resource when you click on a task.


thank you for your answer, but i need to show marks of all resources during the time of that selected task, not just the resource associated with that task.
Its possible?

Its possible too change the query with the mark resources to include another table?
thank you for all.


Thank you for the clarification.
You need to apply a small modification. You need to get the selected task and compare its dates with the cell dates.
Here is an example of how it might be implemented:

Its possible too change the query with the mark resources to include another table?

Do you want to switch between resource charts? If yes, it is possible to do that. You need to use the resourcesStore.clearAll(); command and then parse the new resource data. Here is the snippet that demonstrates that:

If you need something different, please describe your question with more details.


Thank you for your answer.
About the question: “Its possible too change the query with the mark resources to include another table?”
Are a same resources but i need to present the resources marks of 2 tables.

  • in the first table i have the tasks (i use this table on gantt)
  • in the second table i have mettings (i dont use this table on gantt, but i need to show the resources mark with the data in this table).

Its possible to use 2 tables to show the marks?


Thank you for the clarification.
It is possible to have several resource views by specifying them in the layout configuration:

Here is an example:


Thank you for your anwser, but that’s not what i need.
I have one gantt chart, use a db table (tasks) to show, create and edit tasks.
And I have one resources view (to show the resources of the project and show mask resources of the db table
tasks), but I need the resources view show the marks resources of 2 db tables:

  • Tasks (already uses)
  • Mettings (new db table)

The problem is the i cant to show the meetings table on gantt chart, only on the resources view. And i cant have 2 resources view.

Is possible to do that?
Thank you for everything. :slight_smile:


Thank you for the clarification.
If you want to show custom data over tasks in the Gantt chart, you can use the additional layer feature:
Here are the snippets that demonstrate how it works:
You can even use that to draw the elements in the resource view:

If you want to show the data in the resource view from different tables, it is possible, but you need to implement a custom solution.
Actually, you can return any data or HTML elements in the resource cells, even not related to tasks at all. Here is an example:

So, you can combine the resource data that we use from our examples with the data from your table.
Here is the snippet with the data from 2 tables in the resource view:

If that is still not what you want, please show your requirement in a picture/screenshot.


Thank you, I did it. :slight_smile:


I try to use this example http://snippet.dhtmlx.com/6c29b52b1, to replicate this code:

function check_highlight(tasks, start_date, end_date) {
var should_highlight = false;
var id = gantt.getSelectedId();
if (tasks[0] && id) {
    var task = gantt.getTask(id);
    if (task) {
        for (var i = 0; i < tasks.length; i++) {
            if (+start_date >= +task.start_date && +end_date <= +task.end_date) should_highlight = true;
return should_highlight;

But after that when i create or duplicate the task, i have a lot of errors: “Task not found id =1567159745356”.
what can i do?


Please, do not create duplicate questions in different topics.