An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
import { Gantt, ProjectModel, ResourceUtilization, Splitter, DateHelper, AvatarRendering } from '../../build/gantt.module.js?459924';
import shared from '../_shared/shared.module.js?459924';
const project = new ProjectModel({
transport : {
load : {
url : '../_datasets/timeranges.json'
}
},
autoLoad : true,
// This config enables response validation and dumping of found errors to the browser console.
// It's meant to be used as a development stage helper only so please set it to false for production systems.
validateResponse : true
});
Forum post
It can be reproduced by the following steps:
const project = new ProjectModel({ transport : { load : { url : '../_datasets/timeranges.json' } },
autoLoad : true,
// This config enables response validation and dumping of found errors to the browser console. // It's meant to be used as a development stage helper only so please set it to false for production systems. validateResponse : true });
const gantt = new Gantt({ project, appendTo : 'container', viewPreset : 'weekAndDayLetter', tickSize : 40, columnLines : true, features : { timeRanges : { enableResizing : true, showCurrentTimeLine : false, showHeaderElements : true } }, columns : [ { type : 'name', width : 280 }, { type : 'resourceassignment', showAvatars : true, width : 170 } ] });
new Splitter({ appendTo : 'container' });
const resourceUtilization = new ResourceUtilization({ appendTo : 'container', project, partner : gantt, rowHeight : 40, showBarTip : true, features : { timeRanges : { enableResizing : true, showCurrentTimeLine : false, showHeaderElements : true } }, columns : [ { type : 'tree', field : 'name', width : 280, text : 'Resource / Task', renderer({ record, grid, value }) { // lets show event start/end for assignment row if (record.origin.isResourceModel) { const resource = record.origin;
}, { cellCls : 'taskDateRange', renderer({ record, value }) { // Show event start/end for assignment row if (record.origin.isAssignmentModel) { const task = record.origin.event;
} ], bbar : { cls : 'utilization-toolbar', height : '3em', items : [ { type : 'checkbox', ref : 'showBarTip', text : 'Enable bar tooltip', tooltip : 'Check to show tooltips when moving mouse over bars', checked : true, onAction : 'up.onShowBarTipToggle' } ] }, onShowBarTipToggle({ source }) { resourceUtilization.showBarTip = source.checked; } });
project.load();
project.on('load', () => { resourceUtilization.features.timeRanges.timeRanges[2].style = 'background: lightblue;'; });