Page 1 of 1

Web Page - List - controlling the display of list rows

Posted: Thu Apr 26, 2018 9:55 pm
by Joerg Hamacher
Hi,

when working with lists containing a lot of rows our customer wants to have the possibility to position the list by selecting e.g. a customer number.
After typing in a customer number the row of thís customer shall be displayed as first row in the display (without again reading or sorting the list).

So we make a SELECTLIST and when getting to the entry with the given customer number we set:
#List1.CurrentItem.Focus := True

But now - depending on the momentarily shown lsit rows - the row with the selected customer is displayed as first or last row or something in between.
What do we have to do to get this selected row always displayed as the first one?

Best regards,
Joerg

Re: Web Page - List - controlling the display of list rows

Posted: Fri Apr 27, 2018 5:00 am
by caseywhite
This should do what you want. Keep in mind that if the entry is near the bottom of the list, "Top" will not put it at the very top of the list if there aren't enough entries below it.

Code: Select all

Selectlist Named(#List1)
If Cond(#YOURFIELD = YOURVALUE)
#List1.VerticalScrollTo Item(#LiST1.CurrentItem) Scrollposition(Top)
Leave
Endif
Endselect

Re: Web Page - List - controlling the display of list rows

Posted: Fri Apr 27, 2018 5:22 am
by atostaine
That's pretty cool Casey.

Art

Re: Web Page - List - controlling the display of list rows

Posted: Fri Apr 27, 2018 5:37 pm
by Joerg Hamacher
That's great - thank you very much, Casey.
Have a nice weekend,
Joerg