Scrolling news

Post Reply
DIKonsult
Posts: 9
Joined: Mon Jun 17, 2013 2:56 pm

Scrolling news

Post by DIKonsult » Sun Aug 10, 2014 12:58 pm

Hi,
using a JTNewsControl connected to my database.
How do you scroll the news when the items not fit within the component?

Regards
Dag

jomitech
Site Admin
Posts: 1919
Joined: Wed Oct 08, 2008 12:23 am

Re: Scrolling news

Post by jomitech » Tue Aug 12, 2014 8:14 am

Place the JTNewsControl component into a JTScrollBox.
Jon

DIKonsult
Posts: 9
Joined: Mon Jun 17, 2013 2:56 pm

Re: Scrolling news

Post by DIKonsult » Mon Aug 18, 2014 8:36 am

I'm sure I'm missing something here.
I've tried that but I can't get the newscontrol to expand it's size depending on the number of news fetched from the database. And since the newscontrol still is inside the Scrollbox I'm not helped here.
Is there a way to expand the physical size of the NewsControl based on the number of items? You actually don't know how much each item need in hight.

Regards
Dag

jomitech
Site Admin
Posts: 1919
Joined: Wed Oct 08, 2008 12:23 am

Re: Scrolling news

Post by jomitech » Tue Aug 19, 2014 7:35 pm

Actually the simplest way will be to use CSS to add the scrollbars to the JTNewsControl. Put the following CSS code into the page:

Code: Select all

#JTNewsControl1 {
    overflow-y: auto;
}
Jon

DIKonsult
Posts: 9
Joined: Mon Jun 17, 2013 2:56 pm

Re: Scrolling news

Post by DIKonsult » Thu Aug 21, 2014 1:44 pm

?

jomitech
Site Admin
Posts: 1919
Joined: Wed Oct 08, 2008 12:23 am

Re: Scrolling news

Post by jomitech » Mon Aug 25, 2014 12:29 pm

To add CSS to a page, use the JTHeaderCode component and put the following code into the Code property:

Code: Select all

<style type="text/css">
#JTNewsControl1 {
    overflow-y: auto;
}
</style>
Jon

DIKonsult
Posts: 9
Joined: Mon Jun 17, 2013 2:56 pm

Re: Scrolling news

Post by DIKonsult » Wed Aug 27, 2014 2:09 am

Thank's Jon.
As you understand by now, you are dealing with a beginner here.

Dag

Post Reply