How can I change the row height specifically for the resource table?
and in general, can I somehow configure a separate config for a resource?
@ramil
Hello,
How can I change the row height specifically for the resource table?
You can use the row_height
property:
gantt.getDatastore("resource").eachItem(function(item) {
item.row_height = 60;
})
gantt.resetLayout();
Here is an example: DHTMLX Snippet Tool
in general, can I somehow configure a separate config for a resource?
Could you clarify what you mean by a separate config for a resource?
const resourceConfig = {
columns: [
{
name: ‘label’,
label: ‘Text’,
tree: true,
width: 130,
template: function (resource: Record<string, string>) {
return <div class="resource_table_row" data-always-show="${resource.shouldAlwaysVisible}">${resource.label}</div>
;
},
},
],
};
for example here, what other options are there besides columns?
and how i can just read row_height resource row?
Hello,
what other options are there besides columns?
You can also set the following properties:
const resourceConfig = {
scale_height: 100,
row_height: 100,
min_column_width: 100,
scales: [
{ unit: "day", step: 1, date: "%d %M" },
],
columns: [
...
]
};
how i can just read row_height resource row?
You can get the row height of a specific resource like this:
gantt.getDatastore("resource").eachItem((item) => {
item.row_height = item.parent === 0 ? 20 : 50;
});
const resourceItemHeight = gantt.getDatastore("resource").getItem(6).row_height;
console.log(resourceItemHeight);