I am using getWindowbounds to obtain the position of a RadWindow after a drag event, and saving that in a cookie. Then, if they close the RadWindow and later re-open it, I am using setSize and moveTo to reposition it. The code appears as follows:
function WindowMoved(sender, args) { |
window.setTimeout(function() { |
SaveSizeAndPosition(sender, args); |
}, 10); |
} |
function SaveSizeAndPosition(sender, args) { |
var oWnd = $find("<%= RadWindowRealMcCoy.ClientID %>"); |
if (oWnd != undefined) { |
debugger; |
createCookie('RealMcCoyManagerWindowTop', oWnd.getWindowBounds().y, 365); |
createCookie('RealMcCoyManagerWindowLeft', oWnd.getWindowBounds().x, 365); |
createCookie('RealMcCoyManagerWindowHeight', oWnd.getWindowBounds().height, 365); |
createCookie('RealMcCoyManagerWindowWidth', oWnd.getWindowBounds().width, 365); |
} |
} |
function ShowDialog() { |
var oWnd = $find("<%= RadWindowRealMcCoy.ClientID %>"); |
if ((oWnd != null) && (oWnd != undefined)) { |
var x = readCookie('RealMcCoyManagerWindowLeft'); |
var y = readCookie('RealMcCoyManagerWindowTop'); |
var height = readCookie('RealMcCoyManagerWindowHeight'); |
var width = readCookie('RealMcCoyManagerWindowWidth'); |
if (x) { |
if (oWnd._firstShow == undefined) { |
oWnd.setSize(width, height); |
oWnd.moveTo(x, y); |
} |
} |
oWnd.show(); |
} |
} |
It appears that the result of this is a window that is slightly offset from where it should be. See the two images below, the first is after moving the window, and the second is after re-opening it.