[CLOSED] scrollbar position change

  1. #1

    [CLOSED] scrollbar position change

    Hi,

    I am using a taskmanager to update a coolite textarea control every couple of seconds. After i input several rows into the control the scrollbar appears which is great, but the scrollbar position remains at the top of the control. How can i automatically scroll to the bottom of the textarea after every refresh.

    Cheers

    Lee
  2. #2

    RE: [CLOSED] scrollbar position change

    Hi,

    Please see the following sample
    <%@ Page Language="C#" %>
    <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>    
        
        <script type="text/javascript">
            function moveToTheEnd(el){
                if (el.dom.createTextRange) {
                    var r = el.dom.createTextRange();
                    r.collapse(false);
                    r.select();
                }
     
                el.focus();
            }
        </script>
    </head>
    <body>
        <form id="form1" runat="server">
            <ext:ScriptManager ID="ScriptManager1" runat="server">          
            </ext:ScriptManager>
            
            <ext:TextArea ID="Area1" runat="server" Height="100" Width="50" Text="sdfhdjshfjhdjfjsdhjfhjsdhfjhdssjfhjsdhfjdhj444444444444">
            </ext:TextArea>
            
            <ext:Button runat="server" Text="Scroll">
                <Listeners>
                    <Click Handler="moveToTheEnd(#{Area1}.el);" />
                </Listeners>
            </ext:Button>
        </form>
    </body>
    </html>
  3. #3

    RE: [CLOSED] scrollbar position change

    Hi,

    Previous version works in IE only. Here is improvment version
    function moveToTheEnd(el){
                if (el.dom.createTextRange) {
                    var r = el.dom.createTextRange();
                    r.collapse(false);
                    r.select();
                }
                else {
                    el.scroll('bottom', 10000, false)
                }  
                el.focus();         
            }

Similar Threads

  1. [CLOSED] Change Display position of Tabtip in panel
    By legaldiscovery in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Jul 04, 2011, 1:18 PM
  2. [CLOSED] How to change position to show messages?
    By flormariafr in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Aug 06, 2010, 3:41 PM
  3. [CLOSED] Why is there no scrollbar?
    By jmcantrell in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jul 12, 2010, 2:20 PM
  4. Replies: 6
    Last Post: Mar 23, 2010, 1:52 AM
  5. How to change position of window in AjaxEvent?
    By dbassett74 in forum 1.x Help
    Replies: 2
    Last Post: Apr 30, 2009, 2:20 PM

Posting Permissions