Hi!
I hope you guys can help me to figure out why this code is not working properly.
I am trying to render a TreePanel with some items which have long texts on it, so I would expect some scrollbars to appear if necessary, but they don't.
I am using FF 3.5.30729, GXT 2.1.1 and GWT 2.0.2.
Code:
public class MainEntryPoint implements EntryPoint {
public void onModuleLoad() {
ContentPanel panel = new ContentPanel();
panel.setHeading("Content Panel");
panel.setSize(200, 200);
panel.setScrollMode(Scroll.AUTO);
TreePanel tree = new TreePanel(new TreeStore());
tree.setDisplayProperty("text");
tree.setAutoHeight(true);
tree.setAutoWidth(true);
BaseTreeModel mLong = new BaseTreeModel();
mLong.set("text", "This is a very long item text which causes some issues with the scrollbars on ContentPanel/ TreePanel");
tree.getStore().add(mLong, false);
for (int i = 0; i < 30; i++) {
BaseTreeModel m = new BaseTreeModel();
m.set("text", "SomeText");
tree.getStore().add(m, false);
}
panel.add(tree);
RootPanel.get().add(panel);
}
}
The first model item's text is long so one should expect that a horizontal scrollbar should appear immediately. This does not happen for me.
If I then use the vertical scrollbar to scroll down to the end of the tree, I can find the scrollbar, but if I use it another one appears, resulting in a weird behaviour.
Does anyone have the same trouble?
I can not find any scrollbar-methods on TreePanel to change that behaviour, too...
Also see these screenshots:
