Html Area Scrollbar

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Html Area Scrollbar

Postby Janssenjos » Mon Sep 15, 2014 2:35 pm

Hi!

I have a HTML_Area which I show in the webclient. It has a dataprovider, logText, which I update with the work that has been done.
Now how I would like the vertical scrollbar to behave, is that it scrolls to the bottom, when I update the logtText dataprovider. So you always see the last line that is added.

But I just can't figure out how to do that. I tried to set the Y scroll to an high number, but it just stays on top every time.

Does anyone knows how this works?

Thanks!
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Html Area Scrollbar

Postby Janssenjos » Thu Sep 25, 2014 9:28 am

So no one? :(

Bummer...
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Html Area Scrollbar

Postby CFDaddy » Thu Sep 25, 2014 3:16 pm

Not sure if this will help but in a basic web page you can do it like the following:

Code: Select all
var textarea = document.getElementById('textarea_id');
textarea.scrollTop = textarea.scrollHeight;


You can also do it with jQuery like so:

Code: Select all
$(document).ready(function(){
    $('#textarea_id').scrollTop($('#textarea_id')[0].scrollHeight);
});


You can use the Web Client Utils plugins (https://www.servoyforge.net/projects/webclientutils) to get the actual ID of your rendered textarea and replace the 'textarea_id' above with what the plugin returns. This is all theroy at this point because I have not tried it yet but if I get some time today I'll test it out myself and let you know what I find. Hope that helps!

Keith
Keith L. Miller
Director of Technology
ProjecTools
4099 Hwy 36 North, Bellville, Texas 77418
P 713.371.9840 x1601 F 713.371.9841
E millerk@projectools.com W www.projectools.com
User avatar
CFDaddy
 
Posts: 75
Joined: Mon Aug 15, 2011 7:12 pm
Location: Bellville, TX USA

Re: Html Area Scrollbar

Postby CFDaddy » Thu Sep 25, 2014 5:29 pm

I built a sample solution and that process worked like a charm. I've attached it for you to review. Enjoy!
Attachments
test.servoy
(6.11 KiB) Downloaded 472 times
Keith L. Miller
Director of Technology
ProjecTools
4099 Hwy 36 North, Bellville, Texas 77418
P 713.371.9840 x1601 F 713.371.9841
E millerk@projectools.com W www.projectools.com
User avatar
CFDaddy
 
Posts: 75
Joined: Mon Aug 15, 2011 7:12 pm
Location: Bellville, TX USA


Return to Web Development

Who is online

Users browsing this forum: No registered users and 2 guests

cron