aconn7
11 Jan 2010, 4:22 PM
Works fine in Hosted, Chrome and IE8. The tree does NOT display at all in Firefox:
public class BasicTreePanelExample extends LayoutContainer {
@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
Folder model = TestData.getTreeModel();
TreeStore<ModelData> store = new TreeStore<ModelData>();
store.add(model.getChildren(), true);
final TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
tree.setWidth(300);
tree.setDisplayProperty("name");
tree.getStyle().setLeafIcon(Resources.ICONS.music());
ButtonBar buttonBar = new ButtonBar();
buttonBar.add(new Button("Expand All", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
tree.expandAll();
}
}));
buttonBar.add(new Button("Collapse All", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
tree.collapseAll();
}
}));
add(buttonBar, new FlowData(10));
add(tree, new FlowData(10));
}
}
I am curious however how the online GWT 2.1.0 Explorer works ok ...
public class BasicTreePanelExample extends LayoutContainer {
@Override
protected void onRender(Element parent, int pos) {
super.onRender(parent, pos);
Folder model = TestData.getTreeModel();
TreeStore<ModelData> store = new TreeStore<ModelData>();
store.add(model.getChildren(), true);
final TreePanel<ModelData> tree = new TreePanel<ModelData>(store);
tree.setWidth(300);
tree.setDisplayProperty("name");
tree.getStyle().setLeafIcon(Resources.ICONS.music());
ButtonBar buttonBar = new ButtonBar();
buttonBar.add(new Button("Expand All", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
tree.expandAll();
}
}));
buttonBar.add(new Button("Collapse All", new SelectionListener<ButtonEvent>() {
public void componentSelected(ButtonEvent ce) {
tree.collapseAll();
}
}));
add(buttonBar, new FlowData(10));
add(tree, new FlowData(10));
}
}
I am curious however how the online GWT 2.1.0 Explorer works ok ...