Ext JS - 如何滚动到Textarea的底部 [英] Ext JS - How to Scroll to bottom of Textarea

查看:117
本文介绍了Ext JS - 如何滚动到Textarea的底部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我下面的代码。如何滚动到textarea的底部?
它必须像

This is my code below. How can I scroll to bottom of textarea? It must be something like

Ext.getCmp('output').setScrollPosition(Ext.getCmp('output').getScrollHeight());

这是我的textarea代码:

Here is my code for the textarea:

var myWin= new Ext.Window({
            height        :    340,
            title        :    'CHAT',
            modal        :    true,
            resizable    :    false,
            draggable    :    false,
            closable     :    false,
            width        :    477,
            layout       : 'absolute',
            bodyStyle    :    'padding : 10px',
            buttonAlign  : 'center',
            items        :    [
            {
                id           :    'output',
                xtype        :    'textarea',
                width        :    216,
                readOnly     :    true,
                autoScroll   :    true,
                height       :    234,
                x            :    10,
                y            :    10
            },
            item6,
            {
                id       :    'input',
                xtype    :    'textfield',
                width    :    443,
                y        :    249,
                x        :    10
            }]

...

推荐答案

我不认为有ExtJs方法滚动textarea,但是您可以使用HTML textarea属性:

I don't think there is ExtJs method to scroll textarea, however you can use HTML textarea properties:

var t = Ext.getCmp('output'),
   t1 = t.getEl().down('textarea');
t1.dom.scrollTop = 99999;

以下是讨论的问题:动态滚动文本区

这篇关于Ext JS - 如何滚动到Textarea的底部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆