Hello,
We are interested in purchasing dhtmlxGantt. I didn’t see any examples of assigning resources to the gantt tasks. Is there a way that this can be done?
Thanks
Hello,
We are interested in purchasing dhtmlxGantt. I didn’t see any examples of assigning resources to the gantt tasks. Is there a way that this can be done?
Thanks
Hi,
the current version of gantt does not have a core-support of resources as a units with custom availability time that can be associated with the task.
You can assign any value to the task object, e.g. check this example
docs.dhtmlx.com/gantt/samples/04 … _tree.html
But making it work the way the resources are usually used may take a considerable amount of work
Thanks for this. I am not actually looking for include availability time so this might work for me. I just want to be able to assigned multiple resources to tasks.
I see the example and the Assigned To column is perfect. How do you assign/remove resources from this?
Hi,
the resources as in that demo are added as a custom properties to a task objects, i.e. they are not processed by gantt and works just as a part of a data.
You can use a select control to assign it with a lightbox.
docs.dhtmlx.com/gantt/desktop__select.html
Right now there is no multiselect input, but you can port one from dhtmlxScheduler if it’s needed
docs.dhtmlx.com/gantt/desktop__c … ditor.html
github.com/DHTMLX/scheduler/blo … iselect.js
In order to display assigned resources as labels instead of ids which are assigned to the task, you’ll need to define a template for a grid column, e.g.[code]gantt.serverList(“users”, [
{key:1, label: “John”},
{key:2, label: “Mike”},
{key:3, label: “Anna”}
]);
function byId(list_name, id){
var list = scheduler.serverList(list_name);
for(var i = 0; i < list.length; i++){
if(list[i].key == id)
return list[i].label || “”;
}
return “”;
}
gantt.config.columns = [
{name:“text”, label:“Task name”, tree:true, width:’*’ },
{name:“owner”, width:80, align: “center”, template: function(item){ return byId(“users”, item.user) }}
];[/code]