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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Change color

Thread ID:

Created:

Updated:

Platform:

Replies:

128482 Jan 25,2017 11:26 AM UTC Jan 26,2017 07:25 AM UTC JavaScript 1
loading
Tags: ejGantt
Juan Bastidas
Asked On January 25, 2017 11:26 AM UTC

Hi, is possible change the color of tasks and other elements in the gantt?

Jayakumar Duraisamy [Syncfusion]
Replied On January 26, 2017 07:25 AM UTC

Hi Juan Bastidas, 
Thanks for contacting Syncfusion support. 
Please find the response below. 
We can change the color of the tasks and grid cells background in Gantt using queryCellInfo and queryTaskbarInfo client side events.  
We have prepared a sample and updated the taskbar background, progress bar background and TreeGrid cells colors. 
Please find code snippet below. 
queryCellInfo: function (args) { 
    var index = args.data.index; 
    //To change the font color for selected Indexes 
    if (index == 1 || index == 3 || index == 5 || index == 7) 
        $(args.cellElement).css({ "color": "blue" }); 
 
 
}, 
queryTaskbarInfo: function (args) { 
    //To apply background color to parent taskbar 
    if (args.data.hasChildRecords) { 
        //To check the whether custom fields exists or not 
        if (args.data.item.progressbarcolor) { 
            args.parentProgressbarBackground = args.data.item.progressbarcolor; 
        } 
        if (args.data.item.taskbarcolor) { 
            args.parentTaskbarBackground = args.data.item.taskbarcolor; 
        } 
    } 
        //To apply background color to taskbar 
    else { 
        if (args.data.item.progressbarcolor) { 
            args.progressbarBackground = args.data.item.progressbarcolor; 
        } 
        if (args.data.item.taskbarcolor) { 
            args.taskbarBackground = args.data.item.taskbarcolor; 
        } 
    } 
}, 
 
Please refer the KB inks for more information. 
Please refer following UG links to know more about “queryCellInfo” & “queryTaskbarInfo” events and it’s arguments: 
We also prepared sample for your reference. 
 
Regards, 
Jayakumar Duraisamy

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

or the page will be automatically redirected to 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

;