PDA

View Full Version : Textarea can no longer be scrolled.



silcreval
10 May 2009, 2:31 AM
When using a textarea 't', I used to use a trick whereby
I scroll down by a large amount so that any new text is
always typed at the bottom. eg

t.getEl().scroll("down",100000);

This no longer works in Ext 3. This is a breaker for me as my
app wont work without it. The user has to manually scroll
the textarea down every time they want to append text.

Is there another way to do this? It works perfectly
in Ext 2 in IE 6/7/8, FF 1.5+ and Opera/Safari. No idea why
it fails in Ext 3.

silcreval
10 May 2009, 3:19 AM
More generally I get a lot of issues with getEl(), particularly when
using

Ext.fly(somecomponent.getEl)

which often returns undefined. Other times under debug it works fine.

For example, using Ext.fly() inside 'render' code works fine in Ext 2, but
fails in Ext 3 - I've even tried 'afterrender' but getEl() still returns undefined.

Hope some of these issues get resolved in the final release..

silcreval
12 May 2009, 11:41 PM
Still working on this, but not managed to find a solution. This is required
so that you can have a text field which is always scrolled to the bottom.

Otherwise, after updating the field it automatically shifts to the top (scroll
bar at top position). If you've ever tried typing in a textarea that does that
its not good.

I'm thinking one solution is to create a new textarea class that inherits from
the DOM textarea and provides access to the scroll features?

evant
12 May 2009, 11:44 PM
There was a bug with the scroll method that was fixed after RC1.1.

Animal
12 May 2009, 11:55 PM
More generally I get a lot of issues with getEl(), particularly when
using

Ext.fly(somecomponent.getEl)

which often returns undefined. Other times under debug it works fine.

For example, using Ext.fly() inside 'render' code works fine in Ext 2, but
fails in Ext 3 - I've even tried 'afterrender' but getEl() still returns undefined.

Hope some of these issues get resolved in the final release..

That indicates to me that you don't know how to wait until after render to start accessing a Component's elements.

There will not be an element to get until the Component has been rendered.

And if you use debug, it will slow down enough to allow the element to render by the time you get to that code.

silcreval
13 May 2009, 3:08 AM
I did try using 'afterrender', but this didnt help.

silcreval
13 May 2009, 3:09 AM
evant - thanks for the info re the scroll method. I think that was probably
the problem.=D>