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. Image for the cookie policy date

How to refresh component to fill parent div?

I would like to force a refresh/redraw of a Gantt Chart component to expand to fill the parent div (100%). Is there a method I can call to refresh the component to do this?

The scenario is that I have the component inside the body of a Bootstrap accordian (http://getbootstrap.com/javascript/#collapse-example-accordion) where it defaults to collapsed. When I show the panel the component has not expanded to fit it. If on opening I set the component width it makes no difference.


3 Replies

JD Jayakumar Duraisamy Syncfusion Team July 13, 2017 01:21 PM UTC

Hi Mark, 
In Gantt, we have a public method call windowResize, it will update resize the Gantt element by its parent element width & height. Hence, we can call this method once after Bootstrap accordion of Gantt control opened. 
Please refer following code snippet, 
$('#accordion').on('shown.bs.collapse', function (e) {                         
            var $target = e.target; 
            if ($target.id == "collapseTwo") { 
                var ganttObj = $("#GanttContainer").ejGantt("instance"); 
We have also prepared a sample for your reference. Please refer following sample link, 
Please let us know, if you require any other assistance. 
Jayakumar D 

MC Mark Chidlow July 14, 2017 02:29 PM UTC

Perfect - that is exactly what I need.

The sample you provided is excellent and is perfect for my scenario.

Again the level of support Syncfusion provides is second-to-none. Thank you.

JD Jayakumar Duraisamy Syncfusion Team July 17, 2017 04:07 AM UTC

Hi Mark, 
We are glad that your requirement has been met. Please let us know if you need any other assistance. 
Jayakumar D 

Live Chat Icon For mobile
Up arrow icon