Articles in this section
Category / Section

How to hide a specific task bar in Gantt

1 min read

You can hide the specific taskbar in both project and resource allocation views in Gantt. This can be done by using queryTaskbarInfo client side event, which will be triggered for each taskbar being rendered in Gantt

The below code example explains how to hide task bars based on task ID in resource allocation view in Gantt.

<script type="text/javascript">
   $(function () {
         $("#resourceGantt").ejGantt({
                dataSource: resourceGanttData,
                taskIdMapping: "taskID",
                queryTaskbarInfo: function (args) {
                    var taskbarElement = args.taskbar;
                    if (args.data.eResourceTaskType == "resourceChildTask") {
                        if (args.data.taskId == 1 || args.data.taskId == 4) {
                            $(taskbarElement).css("display", "none");
                        }
                    }
                },
                //..
        });
      });
 </script>

 

You can find a sample to hide a task bar in Gantt here.

 

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