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

Positioning issues

15 Answers 327 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jose
Top achievements
Rank 1
Jose asked on 26 Dec 2007, 04:14 PM

Hi,


I have noticed some issues on the positioning on the prometheus rad window. Well I am saving the position of the rad window, so when I load the page just assign that saved position to the window, but if the x or y is greater than the browser size it will just wrap it out at the bottom of the browser instead of positioning on the correct position. I have tried with the offsetelementid, but haven't any success.
I have seen on the demos that it happens the same, you can see it in here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Window/Examples/ShowAndPosition/DefaultCS.aspx

in this, if you have the browser not maximized and you click on "show window 200 pixels below" you will see that the window will show over the that link when it supposed to be below it on 200px.

I discovered that in the asp.net rad windows that doesn't happen:
http://www.telerik.com/demos/aspnet/Window/Examples/ShowAndPosition/DefaultCS.aspx

Does someone has any solution for this? is there a fix for this? I will really appreciate any help.

Thanks in advance.

Jose

15 Answers, 1 is accepted

Sort by
0
Jose
Top achievements
Rank 1
answered on 28 Dec 2007, 07:39 PM
Also, when i am trying to get the top and left of the windows, it returns me the position relative to the windows browser, is there a way to obtain those positions based on the offset element that i specified?

Thanks in advance.

Regards,

Jose
0
Tervel
Telerik team
answered on 02 Jan 2008, 04:24 PM
Hello Jose,

Up to your questions:

1. The window position is always returned relative to the document.
In case you need to calculate the current relative offset to the offsetelementID, you should use a couple of lines of javascript, e.g. (Prometheus code)
    var element  = $get("OffsetElementID");  
      
    var position = Telerik.Web.DomElement.getBounds(element);  
 
    //TODO: Use position.height, width, x and y to calculate relative offset to the window  
      
 

2. At present the RadWindow, as well as a number of other Prometheus controls (RadColorPicker, RadToolTip, RadEditor, RadSplitter) use a common PopupExtender to render and position them on the page. Some of these controls need to be always visible on the page and automatically reposition themselves to avoid rendering partially out of the page viewport. Hence, the behavior you notice in RadWindow.

We agree with you that while in most scenarios having the control fully visible on the page is what is desired, it is not always the case. So, what we will do for Q1 are two additions to this functionality:
- There will be a property that allows the functionality to be turned on or off.
- In the case of RadWindow, there will also be the property that will constrain the movement of a window only within the bounds of a parent element - e.g. the window will be "locked" into the parent element.

Both of these features are already logged for our Q1 Prometheus plans with hight priority and they are certain to appear.

We hope this information helps,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jose
Top achievements
Rank 1
answered on 02 Jan 2008, 08:28 PM
Hi,

So that means right now there is no way to show a radwindow below the browser size (with scroll bars)?
When do you think that the new build with both functionality will be released?
The issue here is that I am making some release in a couple of weeks, and I really need to position the windows correctly. So do you have any recommendations on how to fix this? maybe some client side code or something?

I will really appreciate any help.

Thanks is advance.

Jose
0
Tervel
Telerik team
answered on 07 Jan 2008, 04:57 PM
Hello Jose,

As we suggested in our previous answer, you can try something along the following lines:

//Force a window to render under its opener element       
function OnClientShow(sender, args)  
{      
    //Get cur position of target element and reposition below it  
    var target = $get(sender.get_offsetElementID());  
      
    var position = Telerik.Web.DomElement.getBounds(target);  
      
    position.y = position.y + position.height;          
    var element = sender.get_popupElement();      
    TelerikCommonScripts.setLocation(element, position);  

<

telerik:radwindow runat="server" ID="RadWindow1"
OnClientShow="OnClientShow"
OffsetElementID = "offsetElement"
.../>

The code above will force a window, when being show, to appear under its offsetElement, regardless of the fact whether the window will be fully contained / visible in the browser window.


Greetings,
Tervel
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
Jose
Top achievements
Rank 1
answered on 11 Feb 2008, 03:45 PM
Thanks, everything worked fine with that solution.

I have another issue. On the demo site here:
http://www.telerik.com/DEMOS/ASPNET/Prometheus/Window/Examples/Default/DefaultCS.aspx

Try moving the rad window below the browser. (For example half of the rad window is over the bottom and the other half is below the browser).

Then without scrolling the browser, try to resize the rad window, then you will that the window jumped over.

Is there a fix for this? I need the to stayed where is originally was and not to jump over.

Thanks in advance.

Jose.
0
Svetlina Anati
Telerik team
answered on 12 Feb 2008, 12:28 PM
Hello Jose,

This behavior of RadWindow is implemented by design because of numerous customers' requests. There will be an option to turn off this functionality in the Service Pack which will be released at the end of February.

Best wishes,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jose
Top achievements
Rank 1
answered on 03 Mar 2008, 04:58 PM
Hi Svetlina,

I was wondering when will the release of the service pack for the Prometheus. We are now in March and I didn't see the service pack you were talking.
0
Svetlina Anati
Telerik team
answered on 04 Mar 2008, 09:21 AM
Hello Jose,

We already released the Service Pack. You can download it form your Client.net account,
My Licences/My Free Trials. The newest SP is the one on the top of the list - Q3 2007 SP2.

For your convenience I attach a screenshot of the download section.

Sincerely yours,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jose
Top achievements
Rank 1
answered on 04 Mar 2008, 03:41 PM
Hi Svetlina,

I saw that there is a SP for the Rad Controls, but i don't see it for the Prometheus Rad controls.

Thanks.
0
Svetlina Anati
Telerik team
answered on 04 Mar 2008, 06:12 PM
Hi Jose,

Excuse me for not providing enough detailed information. The SP can be downloaded from the RadControls "Prometheus" section and the file you need is RadControls_Prometheus_2007_3_1425_trial.exe.

You can find more information in the attached screenshot.

Kind regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jose
Top achievements
Rank 1
answered on 04 Mar 2008, 10:20 PM
Hi,

Thanks for your fast reply, I have installed the new version of the prometheus.
Now, i tried the code recommendation above and for this version looks like is not working, looks like now there is no DomElement object under Telerik.Web,
So, how can i use this property again?

Recommended code:
" var position = Telerik.Web.DomElement.getBounds(element); "

Thanks


0
Svetlina Anati
Telerik team
answered on 07 Mar 2008, 05:23 PM
Hello Jose,

We made a lot of changes which optimized the code and the performance of the controls in RadControls "Prometheus" SP2 and make their usage easier.  You still can use the getBounds() method but now you should call it by using the following line:

 var position = $telerik.getBounds(target); 

The discussed new property is called KeepInScreenBounds. We went through your previous posts again and unfortunately we found out that it will not completely fit your particular scenario due to its specifics.


Regards,
Svetlina
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
terrysmith
Top achievements
Rank 1
answered on 11 Mar 2008, 11:00 PM
I'm trying to use your example to position a popup RadWindow directly below a hyperlink when the link is clicked. However, I need to pass in the ID of the hyperlink to a function and show the window instead of setting the OffsetElementID staticly on the <RadWindow... tag.

My function looks like this:

function ShowPopup(linkClientID) 
    var manager = GetRadWindowManager(); 
    var popupWindow = manager.getWindowByName("PopupWindow"); 
         
    var target = $get(linkClientID); 
// target is empty here. 
    var position = $telerik.getBounds(target); 
    positionposition.y = position.y + position.height; 
    var element = popupWindow.get_popupElement(); 
// element is null. 
    TelerikCommonScripts.setLocation(element, position); 
     
    popupWindow.setSize(200,300); 
    popupWindow.setUrl('my url here'); 
    popupWindow.show(); 

Can you point me in the right direction?

Thank you,
Terry
0
Georgi Tunev
Telerik team
answered on 12 Mar 2008, 11:06 AM
Hi Terry,

You can check the following forum thread for a possible implementation:
http://www.telerik.com/community/forums/thread/b311D-gtcaa.aspx#260936
The code is for RadWindow for ASP.NET but the logic is the same - I think it will help in your case.

As an alternative you can use RadToolTip for ASP.NET AJAX which covers this scenario by design.




Greetings,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Arni
Top achievements
Rank 1
answered on 11 Dec 2008, 02:27 AM
HI all,
      I am having a Pblm of Popup the window. The  thing is its link from onw window to thw other window ,.from there to other window link tht.
I am getng the popup within one window .within tht the other window..
tht  colapsing.
the windows should popup like seting target _blank..
where ever the link is set.. the window should come out of all seperatly.only tht can be accsesed until it is closed or redirected.,.
 Kindly help yar...
Tags
Window
Asked by
Jose
Top achievements
Rank 1
Answers by
Jose
Top achievements
Rank 1
Tervel
Telerik team
Svetlina Anati
Telerik team
terrysmith
Top achievements
Rank 1
Georgi Tunev
Telerik team
Arni
Top achievements
Rank 1
Share this question
or