With the current nightly of 3.0p (2012-12-17), pick tree items within list grids do not work any more (tested with FF 17.0.1/Linux)
In previous versions the example below shows a working pick tree when selecting the first line in the empty grid; with the last nightly instead we get this js-error:
"Uncaught JavaScript exception [TypeError: this.menu.setData is not a function] in http://127.0.0.1:8081/effective/gwt/sc/client/widgets/TreeMenuButton.js, line 218"
Is there a workaround for this problem?
I have created a test case to show this behaviour:
In previous versions the example below shows a working pick tree when selecting the first line in the empty grid; with the last nightly instead we get this js-error:
"Uncaught JavaScript exception [TypeError: this.menu.setData is not a function] in http://127.0.0.1:8081/effective/gwt/sc/client/widgets/TreeMenuButton.js, line 218"
Is there a workaround for this problem?
I have created a test case to show this behaviour:
Code:
import com.google.gwt.core.client.EntryPoint; import com.smartgwt.client.Version; import com.smartgwt.client.widgets.form.fields.PickTreeItem; import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.tree.Tree; import com.smartgwt.client.widgets.tree.TreeNode; public class Test implements EntryPoint { @Override public void onModuleLoad() { System.out.println(Version.getBuildDate()); final ListGrid countryGrid = new ListGrid(); countryGrid.setWidth(300); countryGrid.setHeight(340); countryGrid.setShowAllRecords(true); Tree tree = new Tree(); tree.setRoot(departmentRoot); PickTreeItem pickTreeItem = new PickTreeItem(); pickTreeItem.setShowTitle(false); pickTreeItem.setValueField("name"); pickTreeItem.setValueTree(tree); ListGridField valueField = new ListGridField("value", "Value Field"); valueField.setEditorType(pickTreeItem); countryGrid.setFields(valueField); countryGrid.setCanEdit(true); countryGrid.setData(new ListGridRecord [] {new ListGridRecord()}); countryGrid.draw(); } private static final TreeNode departmentRoot = new DepartmentTreeNode("root", new DepartmentTreeNode("Marketing", new DepartmentTreeNode("Advertising"), new DepartmentTreeNode("Community Relations")), new DepartmentTreeNode("Sales", new DepartmentTreeNode("Channel Sales"), new DepartmentTreeNode("Direct Sales")), new DepartmentTreeNode("Manufacturing", new DepartmentTreeNode("Design"), new DepartmentTreeNode("Development"), new DepartmentTreeNode("QA")), new DepartmentTreeNode("Services", new DepartmentTreeNode("Support"), new DepartmentTreeNode("Consulting"))); public static class DepartmentTreeNode extends TreeNode { public DepartmentTreeNode(String name) { setName(name); } public DepartmentTreeNode(String name, DepartmentTreeNode... children) { setName(name); setChildren(children); } } }
Comment