Listformcomponent and show a specific row

Forum to discuss the new web client version of Servoy.

Listformcomponent and show a specific row

Postby bodnarescu.diana » Wed Nov 08, 2023 5:27 pm

Hello,

Is it possible, in a listformcomponent, to show/scroll from code to a specific row?
For example for the aggrid: foundset.setSelectedIndex(15) will automatically scroll the grid to the 15th row.

Thank you,
Diana
Diana Bodnarescu
Servoy Valued Professional
Freelance Servoy Developer
bodnarescu.diana
 
Posts: 25
Joined: Tue Mar 29, 2016 10:43 am

Re: Listformcomponent and show a specific row

Postby bodnarescu.diana » Thu Nov 09, 2023 1:55 pm

Or does anyone have some tricks to scroll to the bottom of the listformcomponent?
I tried with:
.ag-center-cols-viewport {
display: flex;
flex-direction: column-reverse;
}
but it did nothing for the scrollbar.

Would appreciate some ideas,
Thank you,
Diana
Diana Bodnarescu
Servoy Valued Professional
Freelance Servoy Developer
bodnarescu.diana
 
Posts: 25
Joined: Tue Mar 29, 2016 10:43 am

Re: Listformcomponent and show a specific row

Postby mboegem » Thu Nov 09, 2023 2:10 pm

Hi Diana,

did you look into using the plugins.ngclientutils.scrollIntoView() function?
Marc Boegem
Solutiative / JBS Group, Partner
Servoy Specialist
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image
User avatar
mboegem
 
Posts: 1752
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Listformcomponent and show a specific row

Postby bodnarescu.diana » Fri Nov 10, 2023 9:59 am

Hi Marc,

I tried with your suggestion,
Unfortunately I could not make it work with the scroll of the listformcomponent, it is either not possible or I could not find the right selector (I also tried with the selectionClass).
But thank you for the idea, good to know this option is there.

Diana
Diana Bodnarescu
Servoy Valued Professional
Freelance Servoy Developer
bodnarescu.diana
 
Posts: 25
Joined: Tue Mar 29, 2016 10:43 am

Re: Listformcomponent and show a specific row

Postby jcompagner » Tue Nov 21, 2023 3:53 pm

why do you want to scroll to the bottom?
And which bottom? of the currently loaded records (which are only a viewport of the thousands of records that you can have)?

Or really to the last record of the foundset so possible record number 1 million ?

If you want to see the last record sort the other way..
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8833
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Listformcomponent and show a specific row

Postby bodnarescu.diana » Tue Nov 21, 2023 4:51 pm

Hi Johan,

Thank you for your reply.
I was trying to build a chat using listformcomponent. To show the last message in a (normal) chat I need to scroll to the bottom of the list.

Since I could not build it using listformcomponent, I moved to building the chat in the aggrid. When you learn how to style the aggrid, it can look very nice :)
There if i set the foundset's selectedIndex to the last record, scroll goes down to the bottom, although it often jumps a couple of records up.
Code: Select all
//i build my qb
foundset.loadRecords(qb)
var size = databaseManager.getFoundSetCount(foundset)
foundset.setSelectedIndex(size)

It is an aggrid based on the form foundset, and I have max 50 records.
I tried with running this piece of code in the onShow of the chat form, also before showing the chat form, and in both cases I get the same jumpy behavior.
Any ideas in how to eliminate that will be very appreciated.

Thank you,
Diana
Diana Bodnarescu
Servoy Valued Professional
Freelance Servoy Developer
bodnarescu.diana
 
Posts: 25
Joined: Tue Mar 29, 2016 10:43 am


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 29 guests

cron