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

Maximised modal RadWindow changing position on screen

2 Answers 94 Views
Window
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 11 Jul 2014, 07:12 AM
Hi there,

We use a CrystalReportsViewer inside a modal RadWindow to show reports inside our application.  I've received a number of reports from our users that when they move to the next page in a report, the "close button" disappears.  Whilst investigating this issue, I battled to reproduce it until I discovered that it seems to only happen on smaller displays / lower resolutions, perhaps when the content of the RadWindow is larger than the browser window.

Essentially what is happening is that when the next page button is clicked, the RadWindow is "jumping up" a few millimeters and concealing the title bar behind the browser's address bar.  If the user resizes the browser window, even by a FRACTION, or if they zoom in and out (basically anything that causes a redraw), the RadWindow fixes itself immediately.

I have created an animated gif of the phenomenon to try and illustrate the issue.  I have exaggerated the size of the browser window here to replicate the problem clearly. Please take a look and let me know if you have any ideas as to what could be causing this.

Nick

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 11 Jul 2014, 07:29 AM

Hi Nick,

Such behavior can be observed can be observed in the following cases (that I know of):

  • the clicked button is an anchor (i.e., its HTML element is something like <a href="#"></a>), This causes the browser to attempt to scroll so that this anchor is the topmost element, but it is likely that there simply isn't enough content so the change of position is slight
  • the page/content that loads after the button is clicked has default focus. The browser attempts to call scrollIntoView() on that element, but it fails to take into account the absolute positioning of the iframe and thinks that the focused element is in the beginning of the page so it tries to scroll (much like an anchor).

The fixes for these situations are as follows:

  • modify the anchor's href attribute to avoid the browser default behavior: <a href="javascript:void(0);"></a>.
  • remove the default (server) focus and use the Sys.Application.Load event (or any other applicable event when the content is fully rendered) to focus the desired element with a small timeout.
  • if you can - simply raise the window.resize event in the appropriate event. Note that this has to happen on the main page, not in the RadWindow context: http://stackoverflow.com/a/15971955/812369.

I hope this helps so you can incorporate the appropriate idea in your actual case.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Nick
Top achievements
Rank 1
answered on 11 Jul 2014, 01:01 PM
Hi Marin,

Thank you for the swift response!  I was able to solve the issue by raising the window.resize event as you suggested.

Nick
Tags
Window
Asked by
Nick
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Nick
Top achievements
Rank 1
Share this question
or