PDA

View Full Version : Grid layout trouble



Belgabor
24 Feb 2007, 10:12 PM
Hi folks,

I have mentioned now and then here that I have some problems with my grid to behave correctly in regards to layout. I had somehow hoped that those problems would miraculously vanish on one of the updates, but so far in vain :)
I have a BorderLayout and the grid forms the content of the center pane. Troubles start when the grid doesn't fit into the panel. Here is a screenshot of what happens when I first load my app:

http://img155.imageshack.us/img155/984/gridtroubletp5.th.jpg
http://img155.imageshack.us/my.php?image=gridtroubletp5.jpg

As you can see the grid doesn't fit horizontally, so a scroll bar appears, but it overlays the grid itself. Also an (unnecessary) wrongly positioned vertical scrollbar appears. If I resize the browser viewport (opening FireBug comes to mind ;) ), the grid stays as is and the lower part just disappears.
I can "fix" that by using autoScroll: true for the panel, but then the whole (oversized) grid is scrolled within the panel. What I want is the grid to manage scrolling like in the paging example (ie only scrolling the contents without header and paging footer).
As I'm at my wit's (and limitied JS knowledge's) end, I'm open for any input/help/comment :?

jack.slocum
25 Feb 2007, 3:22 AM
What's you doc type and what browser is the problem in?

Belgabor
25 Feb 2007, 7:36 AM
Firefox 2.0.0.2 and originally

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

after I read your post I also tried

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/DTD/loose.dtd">

and xhtml transitional, but it still looks the same.

jack.slocum
25 Feb 2007, 8:09 AM
No sure, let me investigate.

Animal
25 Feb 2007, 9:37 AM
Are you putting the grid in a ContentPanel, or creating a GridPanel from the grid?

Belgabor
25 Feb 2007, 12:04 PM
Are you putting the grid in a ContentPanel, or creating a GridPanel from the grid?

Currently the grid is attached to a separate div within the div used for the panel.
I've tried to attach the grid to the same div that I used to create the panel, but the effect was the almost the same, only the horizontal scrollbar that should be there is gone now (probably overwritten by a content refresh). The vertical bar (that shouldn't be there) is still there and positioned as seen in the screenshot.

jack.slocum
25 Feb 2007, 12:10 PM
Nice question Animal! You need to use a GridPanel or you are in charge of fixing all the stuff that a GridPanel does. Did you implement all that stuff?

Belgabor
25 Feb 2007, 2:12 PM
AAAH! I had missed GridPanel :oops:

It still doesn't work, but need to investigate first whether something I did to try to fix the problem now messes things up. Thanks a lot.

Belgabor
25 Feb 2007, 3:21 PM
After upgrading to rev4 and fiddeleing with the order of setting things up everything works perfectly!
Thanks again! :D