Discuss anything related to web development but no technical support questions


Post by lorde »

I want to display baseline according to some condition,but in what event I should check the condition to set enableBaseline?
Stickman Hook


Post by marcio »

Hey lorde,

Thanks for reaching out and welcome to our forums! :)

To display baselines conditionally, you can use the renderer function provided by the Baselines feature. This function allows you to customize the rendering of baseline elements based on your conditions.

Here's a basic example of how you might implement this:

new Gantt({
    features : {
        baselines : {
            renderer : ({ baselineRecord }) => {
                // Check your condition here
                if (yourCondition) {
                    return baselineRecord.startDate; // or any other content you want to display
                }
                return ''; // Return empty string if condition is not met
            }
        }
    }
});

This approach allows you to dynamically control the display of baselines based on your specific conditions.

Best regards,
Márcio

How to ask for help? Please read our Support Policy


Post Reply