queryTaskbarInfo not working properly with virtualization.

Hi! I have this Gantt Chart, I have aprox. 200 tasks, so I need the virtualization for it to go kinda smooth.

The problem is that I have my function 

const queryTaskbarInfo = (args) => {
const ganttObj = document.getElementById("Editing").ej2_instances[0];
const allTasks = ganttObj.flatData;

const color = getTaskbarColor(args.data);
args.taskbarBgColor = color;

if (canDelayProject(args.data, allTasks)) {
args.taskbarBorderColor = "#FF0000"; // Red border for tasks that may delay the project
args.taskbarBorderWidth = 2;
}
};

That gets the color from:

const getTaskbarColor = (task) => {
const today = new Date();
const startDate = new Date(task.FECHA_INICIO);
const endDate = new Date(task.FECHA_FIN);

console.log("TASK", task);

if (task.PROGRESO === 100) {
return "#4CAF50"; // Green for completed tasks
} else if (today > endDate && task.PROGRESO < 100) {
return "#F44336"; // Red for overdue tasks
} else if (today >= startDate && today <= endDate) {
return "#2196F3"; // Blue for in-progress tasks
} else {
return "#FFC107"; // Yellow for upcoming tasks
}
};



With virtualization enabled, the inital view has all the taskBar colors correctly, but once virtualization enters on scroll, it goes crazy and sometimes it shows the color, other times it doesn't, and it's weird
 

Intitial Load:

After scrolling it goes crazy:


These are my Gantt props:
<GanttComponent
id="Editing"
style={{ borderRadius: "50px !important" }}
dataSource={filteredTasks}
dateFormat={"MMM dd, y"}
treeColumnIndex={0}
durationUnit="Day"
allowSelection={true}
allowFiltering={true}
showColumnMenu={true}
highlightWeekends={true}
allowUnscheduledTasks={true}
projectStartDate={projectStartDate}
projectEndDate={projectEndDate}
taskFields={taskFields}
timelineSettings={timelineSettings}
labelSettings={labelSettings}
splitterSettings={splitterSettings}
height="100%"
editSettings={editSettings}
sortSettings={sortSettings}
allowResizing={true}
allowSorting={true}
gridLines={gridLines}
toolbar={simple ? [] : toolbar}
allowTaskbarDragAndDrop={false}
allowRowDragAndDrop={!simple}
actionComplete={actionComplete}
enableVirtualization={true}
enableTimelineVirtualization={true}
autoCalculateDateScheduling={true}
enableVirtualMaskRow={true}
readOnly={simple}
enableUndoRedo={true}
undoRedoActions={undoRedoActions}
collapseAllParentTasks={simple}
loadChildOnDemand={true}
immediateRender
taskMode="auto"
queryTaskbarInfo={queryTaskbarInfo}
>



3 Replies

SJ Sridharan Jayabalan Syncfusion Team July 19, 2024 12:40 PM UTC

Hi Carlos,


Greetings from Syncfusion.


We have reviewed your query, and we are able to replicate the issue that "QueryTaskbarInfo event's color changes not applied with virtualization" in Gantt Chart.

To address the problem, we have logged a breaking issue, and the fix will be provided in the patch release which is scheduled to be rolled out on July 31, 2024. You can track its status from the feedback link given below.

Note: Kindly login into your account and view the feedback.
Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization

 

 

Regards,

Sridharan



CV Carlos Veryan replied to Sridharan Jayabalan July 19, 2024 08:24 PM UTC

Great, thank you so much!



SJ Sridharan Jayabalan Syncfusion Team August 1, 2024 02:24 PM UTC

Carlos,

 

We appreciate your patience.


The reported issue occurred because trElement is not getting properly while scrolling with virtualization and now the fix for the issue “QueryTaskbarInfo event's color changes not applied with virtualization in React | Feedback Portal (syncfusion.com)” has been rolled out in our latest patch release (v26.2.7). So upgrade to our latest version to resolve the problem.

 

Sample - Qhjfx6 (forked) - StackBlitz

Release notes -  Essential Studio for React Weekly Release Release Notes (syncfusion.com)

Regards,

Sridharan


Loader.
Up arrow icon