This is a migrated thread and some comments may be shown as answers.

can't control width of contents inside 'view'

5 Answers 230 Views
Gantt
This is a migrated thread and some comments may be shown as answers.
BRAD
Top achievements
Rank 1
BRAD asked on 10 May 2015, 08:46 PM
I'm using a Gantt object on one of my sites, but for some reason my day/week/month views are all scrunched up more than they need to be.  I have plenty of whitespace to the right inside the entire gantt object, but the view isn't stretching out to fill it.  I see there is a 'listwidth' option to change the width of the left section, but nothing for the right.  What can i do to fix this?

5 Answers, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 11 May 2015, 07:02 AM
Hi,

By default the gantt widget will try to occupy the whole width of the container in which it is placed and the treelist part is set to be 30% of this available width.  If the width of the gantt widget is too small, please check the size of the wrapping element and increase it accordingly. 

Regards,
Dimitar Terziev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
BRAD
Top achievements
Rank 1
answered on 11 May 2015, 01:53 PM
thanks, but it's not actually the gantt container that's the problem (i believe) since that does fill out 100% of the width.  It's the view contents that are at issue.  See the attached images.  week.png looks fine, but month.png is all scrunched up and doesn't take up the entire width of the gantt object.  
0
Dimitar Terziev
Telerik team
answered on 13 May 2015, 07:09 AM
Hi,

The experience behavior is the expected one. The gantt widget renders time slots for the longest task with few slots prior to the task start as well as slots after the task end. If the time line part is longer than the width of these slots, there is a gap which is observed on our online demos as well. You could control the size of the time slots via the slotSize property. 

Regards,
Dimitar Terziev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
BRAD
Top achievements
Rank 1
answered on 13 May 2015, 02:40 PM
I can probably live with that, except for the fact that in the month view at least there are the columns to the left and right that aren't obeying the slotsize values.  See this image again, where i've set the slotsize to 120.  For some reason the first and last columns are scrunched up.
0
Dimitar Terziev
Telerik team
answered on 15 May 2015, 07:12 AM
Hello,

Each slot is in fact a table header with specific colspan. When the gantt widget renders its headers a calculation is performed how much headers to be rendered depending on the time range of the gantt tasks. In your case there are six headers, the first and the last have colspan of 1, and the four in between have colspan of 4. If you inspect the dom elements, the first and the last header should have width of 30px since the total width is 120px divided by 4 since the maximum colspan is four and they have colspan of 1.

In case this is not the case I would like to ask for a dojo snippet with the exact implementation that you are using.

Regards,
Dimitar Terziev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Gantt
Asked by
BRAD
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
BRAD
Top achievements
Rank 1
Share this question
or