1. #1
    Ext User
    Join Date
    Nov 2007
    Posts
    4
    Vote Rating
    0
    nanobot27 is on a distinguished road

      0  

    Default "ExtJS" way to scroll the window

    "ExtJS" way to scroll the window


    Hi Guys

    Is there an "ExtJS" way to scroll the window (the "native" browser window)

    In normal JS it would look like:

    Code:
    function getScrollXY() {
      var scrOfX = 0, scrOfY = 0;
      if( typeof( window.pageYOffset ) == 'number' ) {
        //Netscape compliant
        scrOfY = window.pageYOffset;
        scrOfX = window.pageXOffset;
      } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
        //DOM compliant
        scrOfY = document.body.scrollTop;
        scrOfX = document.body.scrollLeft;
      } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
        //IE6 standards compliant mode
        scrOfY = document.documentElement.scrollTop;
        scrOfX = document.documentElement.scrollLeft;
      }
      return [ scrOfX, scrOfY ];
    }

    Thank you

  2. #2
    Ext User
    Join Date
    Nov 2007
    Posts
    4
    Vote Rating
    0
    nanobot27 is on a distinguished road

      0  

    Post


    Hey Guys

    I found the answer to my question. Just in case someone else battles with this - it's really easy

    Code:
    var body = Ext.get('docBody');  // add id docBody to your HTML ie. <body id="docBody"> 
                                               // or use DomQuery to get the body tag
    
    body.scrollTo('top', 67);
    Check out Extjs API for Element and also look at the function scroll

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,498
    Vote Rating
    46
    Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Ext.getBody() return the document body Element.

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    82
    Vote Rating
    1
    dr-dan is on a distinguished road

      0  

    Default


    Ext is only javascript after-all, so, just call native:

    Code:
    window.scrollTo(0, 0);
    That worked for me.

    Code:
    Ext.getBody().scrollTo('top', 0);
    did nada.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."