Having problems resizing Gantt Chart

Hello,

I am collapsing a div next to a dhtmlx gantt loaded in via AJAX. This gives the gantt more X realestate.

In my collapse function I call “gantt.setSizes();”. However the gantt does not resize to the new window width and white space is shown.

I’ve checked via a breakpoint and dhtmlxgantt.js is being evaluated, however something with my setup must be different.

Thank-you for your assistance.

Tim

What styles do you have on gantt’s container ?
When calling gantt.setSizes, gantt will adjust the component’s UI to the size of HTML container. So it will adjust UI to the new page size only if size of html container was changed.

Normally having style like “height:100%” on gantt’s container is enough.

Hi,

I checked CSS and it has height:100%;.

I don’t think its a css issue as I tried to also call “gantt.render();” and the gantt did not redraw. Again the dhtmlxgantt.js file evaluated successfully.

Perhaps it is something to do with having loaded the gantt in an ajax container?

I tried for an hour to create a JSfiddle that simulated this, however I gave up because I don’t completely understand how the AJAX simulation works with JSFIddle.

Tim

Check the size of html container, is it really takes all space and gantt is smaller than container ? In such case, you can try to delay the setSizes call ( put it in setTimeout with 1ms delay - it will resolve a possible sizing concurrency )

If you have a live demo - you can send me PM with details.

I’ve checked via a breakpoint and dhtmlxgantt.js is being evaluated, however something with my setup must be different.

Hi,
please provide some kind of demo, it’s hard to tell something without seeing the code