const Editing = () => {
function queryTaskbarInfo(args) { if (args.data.hasChildRecords) { const childRecords = args.data.childRecords;
// Create a parent div to hold all child divs const parentDiv = document.createElement('div'); parentDiv.style.position = 'relative'; parentDiv.style.height = '50px'; parentDiv.style.border = '1px solid #ccc'; parentDiv.style.top = 0; parentDiv.style.position = 'absolute';
for (let i = 0; i < childRecords.length; i++) { // collecting child records left and width values const childRecord = childRecords[i]; const ganttProperties = childRecord.ganttProperties;
// Create a new div element for each child record const childDiv = document.createElement('div');
// applying styles for child divs childDiv.style.position = 'absolute'; childDiv.style.left = `${ganttProperties.left - args.data.ganttProperties.left}px`; childDiv.style.width = `${ganttProperties.width}px`; childDiv.style.height = args.taskbarElement.style.height; childDiv.style.backgroundColor = 'lightgreen'; childDiv.style.marginTop = '-2px';
// Append the child div to the parent div parentDiv.appendChild(childDiv); }
// Append the parent div to the container args.taskbarElement.querySelector('.e-gantt-parent-taskbar') .appendChild(parentDiv); } }
return ( <GanttComponent queryTaskbarInfo={queryTaskbarInfo} > <Inject services={[Edit, Selection, Toolbar, DayMarkers]} /> </GanttComponent> ); }; |