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. Image for the cookie policy date

Conditional milestone coloring

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

3 Replies

JD Jayakumar Duraisamy Syncfusion Team 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 



TT Tomasz Tomczykiewicz January 22, 2019 12:04 PM UTC

Hi Jayakumar,

Thank you for your help. It solved my problem.

Best regards,
Tomasz Tomczykiewicz


JD Jayakumar Duraisamy Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon