dblacha wrote:
> jhonny thio wrote:
>
>> I have tried :
>> this._TextArea.setScrollTop(this._TextArea.getScrollHeight()); in every I
>> update my textarea.
>>
>> this is my code :
>>
>> reqOpen.addEventListener("completed", function(e)
>> {
>> var isi = this._TextArea.getValue();
>> isi = isi + "\n" +mySentence+"\n"+ e.getData().getContent();
>> this._TextArea.setValue(isi);
>>
>> this._TextArea.setScrollTop(this._TextArea.getScrollHeight());
>> }, this);
>>
>> it doesn't work. any other step ?
>>
>>
>>
>
> hi
>
> my solution, without using a qx.ui.form.TextArea.[set|get]Scroll[...], is:
>
> var t = new qx.ui.embed.HtmlEmbed("<textarea id='db_001'></textarea>");
> somewidget.add(t);
> var v = document.getElementById('db_001');
> and in a callback just I do:
> v.scrollTop = v.scrollHeight;
>
> it's working perfectly with <textarea> ale also with <div> and should with
> any other scrollable elements.
>
Right, but this is the exact same thing as using
this._TextArea.getElement().firstChild.scrollTop =
this._TextArea.getElement().firstChild.scrollHeight;
You're working on the DOM element directly (either through
document.getElementById() or _TextArea.getElement()) and setting scrollTop to
scrollHeight. I would prefer the latter form since it saves you from the effort
of going through an HtmlEmbed.
T.
> best regards
> dominik
>
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel