-
22 Nov 2008 8:33 AM #1
Sizing issues when using gxt in a div container
Sizing issues when using gxt in a div container
Hi,
In my host html page I have a specific <div id="mydiv"> tag where I should put my gxt widgets in.
There is an image to the left and to the top of mydiv (actually this is just the background-image visible). Positioning of mydiv is done via css:
Here's a sketch:Code:#mydiv { width: 100%; margin-left: 210px; #This is exactly the width of the image to the left margin-top: 180px; padding: 10px; }
This means that I cannot use the viewport class of gxt because this will take up the entire screen. So I attach a RootPanel to the div and add my widgets to the root panel(RootPanel.get("mydiv").add(...)).Code:____________________ | background | | _______________| | | | | | | | | mydiv | | | | | | | ---------------------
So far so good, but unfortunately the gxt widgets take up to much space horizontally which results in scrollbars added, even when only attaching a simple VerticalPanel with some text in it. What I noticed is that the size of the panel is exactly the size of the gwt shell window! Is this a bug in the library (The correct horizontal size would be window size - left margin)?
If so, should I report a bug for it? I already looked through the forums but could not find a similar problem (maybe everybody is using gxt standalone).
thanks for any help!
-
27 Nov 2008 3:59 PM #2
Unfortunately nobody could help me so far with this issue.
This makes me wonder if it is even possible at all to use gxt inside a div, like with vanilla gwt. Or is this not recommended at all?
-
7 Dec 2008 8:52 AM #3
size a ContentPanel and add your widget to it
size a ContentPanel and add your widget to it
Hello,
maybe you allready solved this problem if not, this work for me and can help you
Why this don't work with a LayoutContainer ? I don't know ...Code:ContentPanel cp = new ContentPanel(); cp.setSize("100%", "100%"); //take the all div cp.setHeaderVisible(false); //remove heading bar cp.setBodyBorder(false); //remove 1px blue border cp.setLayout(new FitLayout()); //change it if you have more than 1 child widget cp.add(new Button()); RootPanel.get("MyDiv").add(cp);
-
10 Dec 2008 6:27 AM #4
Hi,
no unfortunately I was not able to solve this issue. Thanks a lot for your solution, i'll try it out as soon as possible and report back whether it worked for me or not.
-
16 Dec 2008 5:17 AM #5
Unfortunately it did not work for me, it still adds the scrollbars (to accomodate the "empty" space). Do you have any other ideas?
I think it's a bug in the library: gxt cannot handle root panels which are positioned at coordinates different than 0/0 (e.g. in my example above the root panel is positioned with "margin-left: 210px and margin-top: 180px;" Should I open a bug report for this?
-
17 Dec 2008 5:43 AM #6


Reply With Quote