Preventing browser scroll back to top on window open and move

12 posts, 0 answers
  1. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 23 Oct 2009 Link to this post

    Hi,

    We have a very tall form with a href links throughout. If a  user scrolls down, and clicks a link, this opens a radwindow. We are getting the current x and y pos of the mouse so that we set the radwindow position to something relative to where the mouse is - the goal being to just have the window appear wherever you are at in the position of the screen. However, when the radwindow opens, the browser resets the scroll position so we are looking at the top of the page - with our radwindow way down and invisible.

    How can we open a rad window, and set its position but not have the browser scroll back to the top (we are using Firefox 3.5.3 in tests) ? Here is our code. Thanks in advance!

     function openRadWindow(ESID) {
                var oWnd = radopen("ViewFaculty.aspx?ESID=" + ESID, null);
                oWnd.SetSize(600, 550);
               // tempX and tempY are the current mouse x and y positions
                oWnd.moveTo(tempX, tempY);
                return false;


            }
  2. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 26 Oct 2009 Link to this post

    Hello Karl,

    How exactly do you open that RadWindow? For example if you are using <a href="#" onclick="codetoopen()", this will always result in page scrolling up as the browser treats this link as an anchor. Please provide a sample code that would allow us to reproduce the problem locally.


    Kind regards,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Karl Wilkens
    Karl Wilkens avatar
    206 posts
    Member since:
    Oct 2012

    Posted 26 Oct 2009 Link to this post

    Hi, we were doing it just like you suspected

                            ret = ret & "<a href=" & Chr(34) & "#" & Chr(34) & " javascript:openRadWindow(" & dr("EventSpeakerID") & ");>" & fn & "</a>

    So how do we create a link that when clicked, opens a radwindow without that behavior? Thanks.

  4. Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 27 Oct 2009 Link to this post

    Hello Karl,

    Try <a href="javascript:void(0)" onclick="openFn()".



    Greetings,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Mike
    Mike avatar
    1 posts
    Member since:
    Apr 2008

    Posted 22 Nov 2010 Link to this post

    Most useful 18 characters I have read all day.  Tks very much folks.
  6. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 18 Feb 2011 Link to this post

    I'm doing this with a DockCommand.  The DockCommand has an OnClientCommand that calls my JavaScript, which opens the RadWindow.  I'm getting a scroll to top thing going on, too.  How can I avoid this?
  7. LeBear
    LeBear avatar
    233 posts
    Member since:
    May 2006

    Posted 18 Feb 2011 Link to this post

    Ah, solved!  In another thread, I found that setting focus was the problem.  The focus fired before the page was completely loaded.  I'll fix this by registering a startup script.
  8. Shweta
    Shweta avatar
    3 posts
    Member since:
    Dec 2018

    Posted 12 Dec 2018 Link to this post

    I am getting same issues

    I am using hyperlink button in .net.on button click i am calling radopen funtion using J's.

    Radwindow is showing down and parent page got scrolled..

     

    Suggest me answers

  9. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4651 posts

    Posted 12 Dec 2018 Link to this post

    Hi Shweta,

    Take a look through the following threat that explains the most common reasons and solutions to this: https://www.telerik.com/forums/radwindow-moves-by-itself-after-opening.

    If it doesn't help you fix this, open a support ticket and send us an MCVE of the problem so we can take a look.


    Regards,
    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  10. Shweta
    Shweta avatar
    3 posts
    Member since:
    Dec 2018

    Posted 13 Dec 2018 in reply to Marin Bratanov Link to this post

    hii, i have set the property in navigateurl in aspx page.Still getting this issue

    <asp:HyperLink runat="server" ID="hlnkNoteAdd" Text="Add Note" NavigateUrl="javascript:void(0);" ></asp:HyperLink>

    <telerik:RadWindow ID="NoteWindow" runat="server" Modal="True" Height="500px" Width="700px"  
    VisibleStatusbar="false" ReloadOnShow="true" ShowContentDuringLoad="false" CenterIfModal="true">
    </telerik:RadWindow>

    and from code behind using this .In URL i am setting dynamic id

    hlnkNoteAdd.Attributes.Add("onclick", "ShowRadWindow('" + Url + "','NoteWin');");

    Please suggest me

     

     

  11. Shweta
    Shweta avatar
    3 posts
    Member since:
    Dec 2018

    Posted 13 Dec 2018 Link to this post

    I have used keepibscreenbou ds property.now it's showing it in screen boudary but still getting display in different different place, i want to display it in centre...my first problem is solved as i remove textbox.focus from code behind.now parent screen is not scrolled.

     

  12. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4651 posts

    Posted 14 Dec 2018 Link to this post

    Hi Shweta,

    The following article explains the most common problems and solutions from wrong positioning of our controls: https://www.telerik.com/support/kb/aspnet-ajax/details/incorrect-positioning-of-controls.


    Regards,
    Marin Bratanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top