|
[index.html]
<html>
<head>
//……
<link rel='nofollow' href="https://cdn.syncfusion.com/ej2/fabric.css" rel="stylesheet">
</head>
//……
</html> |
|
[index.html]
<html>
<head>
//……
<style>
#Default.e-gantt .e-gantt-chart .e-gantt-child-taskbar-inner-div {
background-color: yellowgreen !important;
}
#Default.e-gantt .e-gantt-chart .e-gantt-parent-taskbar-inner-div {
background-color: lightblue !important;
}
</style>
</head>
</html> |
|
var data = [
{
TaskID: 1,
TaskName: 'Product concept',
StartDate: new Date('04/02/2019'),
EndDate: new Date('04/21/2019'),
ProcessType: 1,
subtasks: [
//……
}];
var ganttChart = new ej.gantt.Gantt({
//……
queryTaskbarInfo: function(args) {
var customField = args.data.taskData.ProcessType;
if(customField) {
if(customField == 1) {
args.taskbarBgColor = "red";
} else if(customField == 2) {
args.taskbarBgColor = "blue";
} else if(customField == 3) {
args.taskbarBgColor = "green";
}
}
}
|