Hello TMS Support Team,
I am developing a web application with Delphi 12 and TMS Web Core, and I’m using the TTMSFNCGanttChart component to display tasks. When I add multiple tasks in a loop, I occasionally get the following JavaScript exception in Chrome’s Developer Console:
Uncaught TypeError: Cannot read properties of undefined (reading 'Left')
at Object.$assign (WEBLib.TMSFNCTypes.pas:390:5)
at t.$clone (rtl.js:508:1)
at Object.DrawDisplay (WEBLib.TMSFNCGanttTimeline.pas:…, etc.)
This happens only sometimes, and more frequently when adding a large number of tasks.
Importantly, this exception occurs only when using the GanttChart under TMS FNC Web Core. I tried the exact same code in a VCL application, and no exception was ever raised.
Original Sample Code
procedure TForm1.btn_addTaskClick(Sender: TObject);
var
i, cc: Integer;
task: TTMSFNCGanttTask;
begin
cc := WebSpinEdit1.Value;
TMSFNCGanttChart1.BeginUpdate;
TMSFNCGanttChart1.Project.BeginUpdate;
try
TMSFNCGanttChart1.Project.Tasks.Clear;
for i := 1 to cc do
begin
task := TMSFNCGanttChart1.Project.AddTask(
Format('%d: test Task', [i]), '');
task.PlannedStart := Date;
task.PlannedEnd := Date + 1;
end;
finally
TMSFNCGanttChart1.Project.EndUpdate;
TMSFNCGanttChart1.EndUpdate;
end;
end;
Troubleshooting Steps Taken
- Ensured updates were suppressed only once (moved both BeginUpdate calls before the loop, and both EndUpdate calls after).
- Set timeline range via TimeLineOptions.ViewDateStart/End to cover all task dates.
- Attempted to use ScheduledStart/ScheduledEnd (not publicly exposed in Web Core) to force real-bar drawing.
- Confirmed use of Web Core–specific properties (PlannedStart/PlannedEnd only).
- Increased timeline buffer around the visible dates.
None of these adjustments have eliminated the error. The Gantt chart still occasionally attempts to read a nonexistent .Left on its internal cell cache when drawing or handling mouse movement, causing the crash.
Request
Could you please advise:
- Whether this is a known issue in the current TMS FNC GanttChart Web Core implementation.
- Recommended usage pattern for bulk-adding tasks without triggering the undefined-property error.
- Any missing properties or methods (e.g. proper way to set real-bar dates) that I may not be aware of in the Web Core version.
- If a bug report is required, which logs or additional information would help you reproduce the problem?
Thank you for your time and assistance. I can provide further details or a minimal reproduction project if needed.
F.Y.I.
Below is the link of conversation url of this matter with chatGPT. (sorry , it's Japanese.)