Articles in this section
Category / Section

Hide and show striplines in Gantt

4 mins read

In the Gantt Control, you can hide the striplines on load time using the create client-side event.

The following code snippet shows how to show the striplines at load time and hide it using the create event.

$("#gantt").ejGantt({

                   //..

                  Create: function (args) {

                    // to hide strip line during load time

                    $(".e-stripline").css("display","none");

                  },

                  // to show strip line during load time

                  stripLines: [

                    { day: "02/06/2017", label: "Project Start", lineStyle: "dotted", lineColor: "Darkblue",                 lineWidth: 2 },

                    //..

                ]

            });

                 

 

You can dynamically hide or show the striplines using an external button.

function grpbtnSelect(args) {

            var ganttObj = $("#gantt").data("ejGantt");

            if (args.index === 0) {

                var stripLines = [

                                { day: "02/06/2017", label: "Project Start", lineStyle: "dotted", lineColor: "Darkblue", lineWidth: 2 },

                                     //..

                ];

                //to show dynamically

                ganttObj.setModel({ "stripLines": stripLines })

 

            }

            else if (args.index === 1) {

                //to hide dynamically

                $(".e-stripline").css("display", "none");

            }

        }

 

You can find a sample to dynamically show or hide the striplines from 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