PDA

View Full Version : Vertical RowLayout margins issue



Alex.Leshkin
13 Aug 2008, 4:35 AM
Sorry, for my bad english:">

Detailed description of the problem
RowLayout with vertical orientation calculates wrong height for percentages columns when column's widget has a top or bottom margins.

Also, RowLayout doesn't take into account margins overlapping.

GXT version
1.0.2

Host mode / web mode / both
both

Browser and version
IE6 SP2, FF 2.0.0.16

Operating System
Windows XP SP2

Sample code
This code demonstrates extra space between bottom label and container border.



public class TestCase extends LayoutContainer implements EntryPoint {

public TestCase() {
super();
setBorders(true);
setLayout(new RowLayout());

LabelField labelField = new LabelField("Label (1, 200)");
labelField.setStyleAttribute("margin", "10px");
labelField.setBorders(true);
this.add(labelField, new RowData(1, 200));

labelField = new LabelField("Label (1, 1)");
labelField.setStyleAttribute("margin", "10px");
labelField.setBorders(true);
this.add(labelField, new RowData(1, 1));
}

public void onModuleLoad() {
Viewport viewport = new Viewport();
viewport.setLayout(new FitLayout());
viewport.add(this);
RootPanel.get().add(viewport);
}

}

Expected behaviour
Space betwee bottom label's border and container border should be 10px

Suggestion
I think next line:


ph -= c.el().getMargins("tb"); //(com.extjs.gxt.ui.client.widget.layout.RowLayout.layoutVertical(El) - line:168)
is a cause of this issue.
When i comment this line extra space is reducing, but still more than 10px. This is because margins overlapping doesn't taked into account by RowLayout.