2012-07-06 302 views
1

我正尝试在运行时将动态停靠面板的大小调整为包含在JavaScript(客户端)中的停靠区的大小。我正在使用Dev Express DockZone和DockPanel。我的JScript看起来像这样:将DockPanel的大小调整为DockZone的高度和宽度

function setDockPanelFill() { 
    var dockPanel = ASPxClientControl.GetControlCollection().GetByName('dockPanel1'); 
    var dockZone = document.getElementById('zone1'); 
    dockPanel.SetHeight = dockZone.offsetHeight; 
    dockPanel.SetWidth = dockZone.offsetWidth; 
} 

任何想法,为什么这不起作用?

回答

3

设置ASPxDockZoneClientInstanceName至例如dockZone1。
设置ASPxDockPanelPanelUID至例如dockPanel1。
此外,SetHeightSetWidth是方法,而不是属性。
所以,你的代码应该是这样的:

function setDockPanelFill() { 
    var dockPanel = dockZone1.GetPanelByUID('dockPanel1'); 
    dockPanel.SetHeight(dockZone1.GetHeight()); 
    dockPanel.SetWidth(dockZone1.GetWidth()); 
} 
+0

谢谢,这个精美的作品! – CodeMan5000 2012-07-09 20:59:52

相关问题