我有一个 gwt 项目,其中包含两个 Vlayouts(dialogVLeftPanel、dialogVRightPanel)。该 Vlayouts 包含一个树形网格,如下面的代码所示:
/////////// drzewo użytkowników
userViewTree = new Tree();
userViewTree.setModelType(TreeModelType.PARENT);
userViewTree.setIdField("UserViewId");
userViewTree.setParentIdField("ReportsTo");
userViewTree.setNameProperty("Użytkownicy");
userViewTree.setRootValue(1);
userViewTree.setData(userViewData);
TreeGrid userViewTreeGrid = new TreeGrid();
userViewTreeGrid.setHeight(600);
userViewTreeGrid.setWidth(185);
userViewTreeGrid.setShowOpenIcons(false);
userViewTreeGrid.setShowDropIcons(false);
userViewTreeGrid.setClosedIconSuffix("");
userViewTreeGrid.setFields(new TreeGridField("Użytkownicy"));
userViewTreeGrid.setData(userViewTree);
userViewTreeGrid.getData().openAll();
dialogVLeftPanel.addMember(userViewTreeGrid);
///////////////////////////////////////////////////
//////////////drzewo uprawnień/////////////////////
///////////////////////////////////////////////////
Tree userTree = new Tree();
userTree.setModelType(TreeModelType.PARENT);
userTree.setRootValue(1);
userTree.setNameProperty("Uprawnienia");
userTree.setIdField("userId");
userTree.setParentIdField("ReportsTo");
userTree.setOpenProperty("isOpen");
userTree.setData(userData);
final TreeGrid userTreeGrid = new TreeGrid();
userTreeGrid.setHeight(600);
userTreeGrid.setWidth(630);
userTreeGrid.setShowOpenIcons(false);
userTreeGrid.setShowDropIcons(false);
userTreeGrid.setClosedIconSuffix("");
userTreeGrid.setData(userTree);
userTreeGrid.setSelectionAppearance(SelectionAppearance.CHECKBOX);
userTreeGrid.setFields(new TreeGridField("Uprawnienia"));
userTreeGrid.setShowSelectedStyle(false);
userTreeGrid.setShowPartialSelection(true);
userTreeGrid.setCascadeSelection(true);
dialogVRightPanel.addMember(userTreeGrid);
我想在 Vlayouts 之间放置可调整的栏,因为我想在需要时更改两个宽度。 当我输入该代码时:
userTreeGrid.setShowResizeBar(true);
调整大小栏是可见的,但它位于Vlayout的底部,只能缩短面板。如果我想扩大面板 - 这是行不通的。
我该如何解决我的问题?
感谢您的帮助!
最佳答案
您设置了两个 VLayout
,因此您需要将 setShowResizeBar(true)
应用于左侧 VLayout
,而不是应用于 TreeGrid
因为您真正想要的是能够调整容器的大小。
关于java - smartgwt - 两个相邻面板(vlayouts)不可调整大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12819325/