Articles in this section
Category / Section

How to format the cell content style in Gantt

1 min read

It is possible to format the cell content style in Gantt using queryCellInfo client side event. This event will be triggered while rendering each cell in Gantt.

The below code example explains how to customize the font color of a cell using queryCellInfo event,

<div id="GanttContainer" style="width:100%;height:450px;" /> 
<script type="text/javascript"> 
$(function () { 
            $("#GanttContainer").ejGantt({ 
                dataSource: data, 
                //.. 
                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" }); 
                }, 
            }); 
        }); 
</script>

 

Customize the font color of cell in Gantt

Sample with customized font colors for a task item is available in the following link,

Sample

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied