1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
    trisport88 is on a distinguished road

      0  

    Default Answered: Auto scrolling to end of read only textarea

    Answered: Auto scrolling to end of read only textarea


    Hi,

    I am trying to auto scroll a read only textarea however none of the solutions I have found online are working for me. I am an Ext JS beginner.

    Using 'http://dev.sencha.com/deploy/ext-4.0.0/examples/form/absform.html' as an example I have built a similar window. The last item in panel is as follows:

    this.mPanel = new Ext.FormPanel({ layout: 'absolute',
    defaultType:'textfield',
    border: false,
    ...
    }, {
    x:5,
    y: 155,
    id: 'output',
    xtype: 'textarea',
    margin: 0,
    hideLabel: true,
    readOnly: true,
    autoScroll: true,
    name: 'msg',
    anchor: '-5 -5' // anchor width and height
    }],

    To update the value I am doing the following:

    var textOutput = this.mPanel.getComponent('output').getValue();
    this.mPanel.getComponent('output').setValue(textOutput + 'some other value\n');

    After this I have tried multiple different method to get the textarea to scroll to the bottom e.g.

    (1) this.mPanel.getComponent('output').getEl().dom.scrollTop = 99999;
    (2) this.mPanel.getComponent('output').selectText(textOutput.length);
    (3) this.mPanel.getEl().scroll('b', Infinity);
    (4) this.mPanel.getComponent('output').getEl().scrollBy(100,100, true);
    ...
    It may be that one of the options I have tried were almost (but not quite right!). Help would be greatly appreciated.

  2. Format your code using
    HTML Code:
    [CODE][/CODE]
    Try selecting only last letter of entered text

  3. #2
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
    trisport88 is on a distinguished road

      0  

    Default


    Just to add we are using 4.0 (not 4.1)

  4. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    7
    Vote Rating
    0
    trisport88 is on a distinguished road

      0  

    Default


    I found an alternative solution from the sencha examples:

    http://dev.sencha.com/deploy/ext-4.0...ct/direct.html

  5. #4
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4
    Vote Rating
    4
    metalinspired is on a distinguished road

      0  

    Default


    Format your code using
    HTML Code:
    [CODE][/CODE]
    Try selecting only last letter of entered text

Thread Participants: 1

Tags for this Thread

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar