下面是我的代码。如何滚动到文本区域的底部? 一定是这样的
Ext.getCmp('output').setScrollPosition(Ext.getCmp('output').getScrollHeight());
这是我的文本区域代码:
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 方法来滚动文本区域,但是您可以使用 HTML 文本区域属性:
var t = Ext.getCmp('output'),
t1 = t.getEl().down('textarea');
t1.dom.scrollTop = 99999;
这是讨论的问题:Dynamically Scrolling a Textarea
关于javascript - Ext JS - 如何滚动到文本区域的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10964667/