Show resources marks after selected task

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

Thank you.

Hello,
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:
http://snippet.dhtmlx.com/bd94b2230
It has the additional functionality to show the resource when you click on a task.

Hello,
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.

Hello,
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:
http://snippet.dhtmlx.com/6c29b52b1


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:
http://snippet.dhtmlx.com/ebad24bf7

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

Hello,
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?

Hello,
Thank you for the clarification.
It is possible to have several resource views by specifying them in the layout configuration:
https://docs.dhtmlx.com/gantt/desktop__layout_config.html

Here is an example:
http://snippet.dhtmlx.com/b95fb59de

Hello,
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:

Hello,
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:
https://docs.dhtmlx.com/gantt/api__gantt_addtasklayer.html
Here are the snippets that demonstrate how it works:
https://snippet.dhtmlx.com/0157f969f
https://snippet.dhtmlx.com/a6f4651b3
https://snippet.dhtmlx.com/536832002
https://snippet.dhtmlx.com/fc08cb2c3
You can even use that to draw the elements in the resource view:
https://snippet.dhtmlx.com/a6e17d1d2
https://docs.dhtmlx.com/gantt/samples/10_layout/02_resource_panel.html

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:
https://snippet.dhtmlx.com/3613625d8

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:
http://snippet.dhtmlx.com/62f7a3453

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

1 Like

Thank you, I did it. :slight_smile:

Hello.
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?
Thanks

Hello,
Please, do not create duplicate questions in different topics.