1. #1
    Ext User
    Join Date
    Oct 2008
    Posts
    26
    Vote Rating
    0
    DirtDog is on a distinguished road

      0  

    Default TextArea Scroll to Top

    TextArea Scroll to Top


    I did the usual search for an answer but didn't find any.

    I want to scroll to the top of a Ext.form.TextArea.

    How do I do this?

    Ed

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

      0  

    Default


    Same was as you always scroll scrollable elements to the top in all the HTML pages you've ever written.

    Set the scrollTop of the HtmlElement to 0

  3. #3
    Ext User
    Join Date
    Oct 2008
    Posts
    26
    Vote Rating
    0
    DirtDog is on a distinguished road

      0  

    Default No Joy

    No Joy


    I tried your suggestion. No go. The scroll bar stays at the bottom.

    I have several cards in a card layout.

    I switch to the form with the TextArea, scroll to the bottom, then switch to another form
    in the card layout, then switch back to the form with the TextArea.

    Right before calling setActiveItem to switch to the form with the TextArea I call load on a Store, the Store Load event calls:

    function CLP_AccountLettersStoreLoad(StoreObj, Records, Options)
    {
    if (Records.length == 0) return;
    var FormObj = WindowObj.findById('AccountLettersForm');
    FormObj.getForm().loadRecord(Records[0]);
    CLP_AccountLettersScrollTop();
    }

    function CLP_AccountLettersScrollTop()
    {
    var FormObj = WindowObj.findById('AccountLettersForm');
    var LetterObj = FormObj.findById('Letter');
    LetterObj.getEl().scrollTop = 0;
    FormObj.doLayout();
    }

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

      0  

    Default


    getEl.

    What does it return?

  5. #5
    Ext User
    Join Date
    Oct 2008
    Posts
    26
    Vote Rating
    0
    DirtDog is on a distinguished road

      0  

    Default Joy

    Joy


    Got it. Works.

    Thanks,

    Ed

Thread Participants: 1