2012-07-06 308 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

相關問題