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
close icon

Resize Gantt

I had no success on resizing Gantt.

I would like to set height and width for Gantt when the browser resizes.

I tried this:

for javascript:
$(document).ready(function () {
        $(window).bind('resize', function () {
            $("#myGantt").ejGantt(
            {
                sizeSettings: { height: "900px", width: "1200px" }
            });
        }).trigger('resize');
    });


On my view I have this:

@(Html.EJ()
    .Gantt("myGantt")
    .SizeSettings(grid =>
    {
        grid.Height("500px");
        grid.Width("1500px";
    })

The code above didn't work.

Tried to put Gantt inside a div too with the same id but didn't work too.

How can I do this?

Regards,
Otto Machado.

5 Replies

JR John Rajaram Syncfusion Team January 23, 2015 11:20 AM UTC

Hi Otto,

Thanks for using Syncfusion products.

We would like to let you know that, we can resize our Gantt control by using the EnableResize property.

Please refer the below code snippets for more details.

Code snippets:

<head>

   //...

   <style>

        /*we have to set height and width for resizing Gantt dynamically*/

        #Gantt

        {

            position:absolute;

            height:100%;

            width:100%;

        }

   </style>

</head>

<body style="position: static; margin: 0px; padding: 0px">

@(Html.EJ().Gantt("Gantt").

    //...

   .EnableResize(true)

   .SizeSettings(eve =>

       {

           eve.Height("900px");

           eve.Width("1200px");

      

       })

   .Datasource(ViewBag.dataSource)

  )

@(Html.EJ().ScriptManager())

 

We have also prepared a sample based on this for resizing Gantt and you can find the sample under the following location:

Sample: http://www.syncfusion.com/downloads/support/directtrac/118037/MVC09NewSampleResize922105385.zip

Please let us know if you require further assistance on this.

Regards,
John. R




OM Otto Moura Machado Filho January 23, 2015 01:38 PM UTC

Thanks, it worked.

Just one more question. How can i set the initial position of the SplitDivider (that divides the grid from chart). It has about 300px of width, I'd like to set a higher value.

Regards,
Otto Machado.


BM Bharath Marimuthu Syncfusion Team January 26, 2015 06:21 AM UTC

Hi Otto,

Thank you for the update.

We have created a new incident #134442 on behalf of you related to this forum. We suggest you to follow up the incident for further reference using your direct-trac account.

Our Direct Trac support system can be accessed from the following link:

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents

Please let us know if you require further assistance on this.

Thanks,

Bharath




OM Otto Moura Machado Filho January 26, 2015 04:13 PM UTC

Ok. I'll wait for it.

Regards,
Otto Machado.


JR John Rajaram Syncfusion Team January 27, 2015 09:15 AM UTC

Hi Otto,
 
Thanks for the update.
Please let us know if you require further assistance on this.
 
Regards,
John R



Loader.
Live Chat Icon For mobile
Up arrow icon