如何在gtml中的特定DIV中显示gwtext.client.widgets.Window的实例?我试过window.anchorTo(DOM.getElementById(“Some_Div”),“left”,new int [] {0,0}),认为窗口将自己锚定到我的html中的div id =“Some_Div”。它没有。
答案 0 :(得分:1)
我在几个月内没有使用gwt-ext库,但如果你还没有,你可能想尝试一下。 应该将小部件附加到您想要的位置。也就是说,在某些情况下,gwt-ext小部件的反应方式对于真正理解正常GWT小部件的人来说并不直观。
RootPanel.get("Some_Div_Id").add( someWidget )
答案 1 :(得分:0)
你应该使用
window.alignTo(DOM.getElementById("Some_Div"),"tl-tl", new int[]{0,0});
用于将窗口的左上角定位到Some_Div的左上角。
这些是位置参数的有效字符串:
Value Description
----- -----------------------------
tl The top left corner (default)
t The center of the top edge
tr The top right corner
l The center of the left edge
c In the center of the element
r The center of the right edge
bl The bottom left corner
b The center of the bottom edge
br The bottom right corner
有关详细说明,请参阅Ext文档。