PDA

View Full Version : How to get grid column to stretch complete width of grid?



dbassett74
30 Jul 2009, 2:04 PM
I have a grid that will contain a single column. I want the column to span the complete width of the grid. I specified autoExpandColumn on this column, but it seems like it doesn't expand all the way to the right. It appears as though its leaving room for a vertical scrollbar. Obviously, it should resize it self to display a vertical scrollbar WHEN it is needed. But if not currently needed, can't it stretch all the way over? I have attached a screenshot of this.

Condor
30 Jul 2009, 2:36 PM
You can set:

viewConfig: {scrollOffset: 0}

But that space is needed for a vertical scrollbar, so you should ONLY set the scrollOffset to 0 if you know for sure that a vertical scrollbar will never be shown.

steffenk
30 Jul 2009, 2:39 PM
isn't this behaviour unlike normal OS behaviour or webpage? stretch normally uses full width if scrollbar isn't displayed.

Condor
30 Jul 2009, 2:42 PM
It's a limitation of webbrowsers:
There is no signal if a scrollbar is shown or hidden, so to get the same display with and without scrollbar you have to reserve space for it.

dbassett74
30 Jul 2009, 2:44 PM
isn't this behaviour unlike normal OS behaviour or webpage? stretch normally uses full width if scrollbar isn't displayed.

Yes, this is definitely not normal behavior.

The grid will sometimes need a vertical scrollbar and sometimes not. You can never make that assumption as the developer. Why doesn't it just stretch automatically? Seems strange and surprised no one has ever had a problem with this and we're already on v3.0. Anyway to fix this? Out of curiosity, I took a look at the ListView example to see if that handles it any better. It seems that it handles it a little better by making the column expand all the way to the right regardless if there is a vertical scrollbar or not, but when there is NOT a vertical scrollbar, the row highlight does not expand all the way to the right.

steffenk
30 Jul 2009, 2:45 PM
i think you don't need to do that, as it's DOM and Browser does that automatically.