Try redownloading it? It’s possible I changed it earlier after you downloaded it. I’ve worked on 14 different projects today, so anything is possible. I can tell you that the version I downloaded from the link I supplied has that.
At any rate, the logic is the same. Load cells in Open, ScrollToBottom in Shown or at some point after.
The code works, you just need to implement in a way that works for you. These implementation details are likely going to be very project-specific, so you’re essentially on your own there, but bear in mind that you can use Timer.CallLater after adding items to help ensure that the scroll code executes after the containers are embedded.
That makes sense. The difference is still that I’m adding the container in real time. I have to believe it’s the asynchronous problem where it’s running your command before the container is visible so that the command thinks it’s at the bottom.
Thanks. I can’t get timer.calllater to work. I’m getting an error on the command “timer.callLater(2000, addressOf scrollToBottom)” that ‘there is more than one method with this name and this does not match any of the available signature’
Yeah, thinking more about it, that’s probably not the best way to go as it won’t be Session-aware. To make things simple, you can add a Timer to your WebContainer with the following properties:
Public Sub scrollToLeft(extends c as WebContainer)
'// myContainer.scrollToLeft
if Session <> Nil then
session.ExecuteJavaScript( "var container = document.getElementById('" + c.ControlID + "');container.scrollLeft = 0;" )
end if
End Sub
Public Sub scrollToRight(extends c as WebContainer)
'// myContainer.scrollToRight
if Session <> Nil then
Session.ExecuteJavaScript( "var container = document.getElementById('" + c.ControlID + "');container.scrollLeft = container.scrollWidth - container.clientWidth;" )
end if
End Sub