Premium support for our pure JavaScript UI components


Post by ext_mkucanda »

Hello,

Our clients experienced an issue with the set baseline functionality in Gantt component. I was able to reproduce it in your example: https://bryntum.com/products/gantt/examples/baselines/

Open developers console and try to delete any task start or task end date. There is an error in the console: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getTime') You get this error also if you try to click 'Set baseline' button again.

In addition, if there is unscheduled task in the grid (with no start date and end date) and you click set baseline for the first, time this error also appears.

I am attaching the print screen. It seems to me that baseline is not supported for unscheduled tasks.

Thank you

Attachments
Screenshot 2025-01-22 at 12.19.46.png
Screenshot 2025-01-22 at 12.19.46.png (627.93 KiB) Viewed 142 times

Post by ghulam.ghous »

Hello there,

Open developers console and try to delete any task start or task end date. There is an error in the console: Uncaught (in promise) TypeError: Cannot read properties of null (reading 'getTime') You get this error also if you try to click 'Set baseline' button again.

This is an application level error and it can be resolved by updating the example code to this:

    baselineRenderer = ({ baselineRecord, taskRecord, renderData }) => {
        if (baselineRecord.isScheduled && taskRecord.isScheduled && taskRecord.isScheduled && baselineRecord.endDate.getTime() + 24 * 3600 * 1000 < taskRecord.endDate.getTime()) {
            renderData.className['b-baseline-behind'] = 1;
        }
        else if (taskRecord.endDate < baselineRecord.endDate) {
            renderData.className['b-baseline-ahead'] = 1; 
        }
        else {
            renderData.className['b-baseline-on-time'] = 1;
        } 
    },

We will update the example code.

In addition, if there is unscheduled task in the grid (with no start date and end date) and you click set baseline for the first, time this error also appears.

This seems like an error in our implementation. We will investigate this here: https://github.com/bryntum/support/issues/10650


Post by ext_mkucanda »

Thank you for resolving this so fast! :)

Is there a quick workaround that I can apply to fix this immediately or should I wait for v6.1.6 to be released so I upgrade?

Mislav


Post by marcio »

Hey Mislav,

The best would be to wait for the release, which shouldn't take long to be released.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post Reply