This is a migrated thread and some comments may be shown as answers.

how to get the current position of radwindow

3 Answers 114 Views
Window
This is a migrated thread and some comments may be shown as answers.
yao wang
Top achievements
Rank 1
yao wang asked on 11 May 2010, 08:54 PM
If I want to get the current position of radwindows, which could be draged and droped anywhere in the window , I add the onclientdragend in radwindowmanager like following.

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Mac"   
        VisibleStatusbar="False" VisibleOnPageLoad="True"   
        onclientdragend="SaveState"   >
    </telerik:RadWindowManager> 

then I implenent the savestate function as following.
function SaveState(sender, eventArgs)  
{
              
    window.setTimeout(function() {  
    var bounds = sender.getWindowBounds();  
    clientSaveState.PerformCallback(sender.get_name() + "|" + bounds.x + "|" + bounds.y + "|" + bounds.height + "|" + bounds.width + "|" + sender.isClosed());  
    }, 0);  
}  

My question is how to write the   clientSaveState.PerformCallback ? how does every radwindow under the radwindow manager update its bounds.x and bounds.y immediately after moving?

Thanks

3 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 12 May 2010, 07:35 AM
Hi yao wang,

To get all RadWindows, you should use RadWindowManager's GetWindows() method. Once you have a reference to that Windows object, you can loop trough the windows and get their properties. Since you will be using a FOR cycle, I would suggest not to use getWindowsBounds() with a timeout, but Telerik's static client library for that purpose.

For convenience I attached a small sample that shows how to get the properties of every RadWindow on a given page (assuming that they are all opened via the same RadWindowManager).


All the best,
Georgi Tunev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Vincent
Top achievements
Rank 1
answered on 27 May 2010, 11:08 PM
Hi, Georgi ,

I noticed that from the code in your attached sample solution, when you do "$telerik.getBounds(win.get_popupElement())" , it returns the absolute bounds.

But in my scenario, I have a RestrictionZone attached to my RadWindowManager.
How would I get the relative bounds then?

Please advise. Thanks.

Vincent
0
Vincent
Top achievements
Rank 1
answered on 28 May 2010, 03:23 PM
Got it. It's simply "win.getWindowBounds();"

Vincent
Tags
Window
Asked by
yao wang
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Vincent
Top achievements
Rank 1
Share this question
or