Far*_*mov 3 javascript extjs extjs3
这是我的代码.如何滚动到textarea的底部?它一定是这样的
Ext.getCmp('output').setScrollPosition(Ext.getCmp('output').getScrollHeight());
Run Code Online (Sandbox Code Playgroud)
这是我的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
}]
Run Code Online (Sandbox Code Playgroud)
...
我不认为有滚动textarea的ExtJs方法,但是你可以使用HTML textarea属性:
var t = Ext.getCmp('output'),
t1 = t.getEl().down('textarea');
t1.dom.scrollTop = 99999;
Run Code Online (Sandbox Code Playgroud)
以下是讨论它的问题:动态滚动Textarea