We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback
Essential JS2

Syncfusion jQuery based widgets are no longer in active development. Switch to our pure JavaScript based next generation Essential JS 2 library.

Conditional milestone coloring

Thread ID:

Created:

Updated:

Platform:

Replies:

142158 Jan 22,2019 10:34 AM UTC Jan 22,2019 01:29 PM UTC jQuery 3
loading
Tags: ejGantt
Tomasz Tomczykiewicz
Asked On January 22, 2019 10:34 AM UTC

Hi,

I have a function attached to queryTaskbarInfo event and it works for tasks. But I want to set a color in the way for a milestone. How can I achieve this?

export function customizeTaskbar(args) {
    if (args.data.item.status === 0)
        args.taskbarBackground = args.parentTaskbarBackground = 'grey';

    else if (args.data.item.status === 1)
        args.taskbarBackground = args.parentTaskbarBackground = 'yellow';

    else if (args.data.item.status === 2)
        args.taskbarBackground = args.parentTaskbarBackground = 'green';
}

Best regards,
Tomasz Tomczykiewicz

Jayakumar Duraisamy [Syncfusion]
Replied On January 22, 2019 11:20 AM UTC

Hi Tomasz, 
We can achieve your requirement by following code snippet, 
function queryTaskbarInfo(args) { 
            //Applying Background colors 
            if (args.data.isMilestone) { 
                $(args.taskbar).find(".e-gantt-template-milestone").css("margin-top", "0px"); 
                args.milestoneBackground = "violet"; 
            } 
        } 
We have also prepared a sample for your reference. Please find the sample as below location, 
Regards, 
Jayakumar D 


Tomasz Tomczykiewicz
Replied On January 22, 2019 12:04 PM UTC

Hi Jayakumar,

Thank you for your help. It solved my problem.

Best regards,
Tomasz Tomczykiewicz

Jayakumar Duraisamy [Syncfusion]
Replied On January 22, 2019 01:29 PM UTC

Hi Tomasz, 
We are happy that your problem was resolved. 
Please let us know, if you need further assistance. 
Regards, 
Jayakumar D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon