Xojo2025R2.1: WebListBox.ScrollTo with Data Source

I would like to select row that is added to the list but need to scroll manually to see it when list has certain number of rows and the newly added row is beyond visible range.

It seems that I need to use java script to make it happen. According to friendly ChatGPT:

“The practical, reliable workaround is to ask the browser-side list to scroll itself to the virtual row — that triggers the client-side DataTables scroller to request the needed rows and render them. You can do that by executing a small JavaScript snippet from Xojo which calls the DataTables scroller API (or falls back to a DOM scrollIntoView if necessary). Many Xojo users have used that approach successfully.”

Wouldn’t it be better to have build-in Xojo method in WebListBox instead?

You tried WebListBox.ScrollTo and it doesn’t work?
How doesn’t work, the RowIndex provided is wrong or didn’t scroll?
Note: I haven’t used WebListBox.ScrollTo

Well, the problem has to do with visible range of record in the list, if I scroll “by hand” then the list rebuilds and the last row will show up selected as expected, however, if I want to do the same via code using ScrollTo then it does not scroll and rebuild the list.

As already mentioned, I have implemented java script to do the scrolling and it seems to work now.

You can create a feature request here.
Explaining what you wanted to do, what .ScrollTo doesn’t do and some java script can be used to make it work.
I’m sure @Ricardo_Cruz may add that to a future version of Xojo.