This content has been marked as final. Show 3 replies
"...I've tried capturing the scoll position before i begin my updates, and then setting it back when finished..."
This is the correct approach.
Try it again, but this time, after the update to the dataProvider, use callLater() to call the function that restores the scroll position.
You often need to use callLater() after updating a dataProvider, or assigning a dp to a control in order to give the control a chance to be rendered before performing visually oriented actions on the control.
Interesting. makes sense. While this does indeed succeed in scrolling the grid to the correct position, there is quite a noticeable delay - the scroll will be back at the top of the list for almost one second ("one one thou-") before rescrolling down to the captured position. wish there was a "callSoonerRatherThanLater" type of function ;)
Actually, I spoke too soon. I had a number of things I was trying. And when i tried to clean up the other things that I believed were extraneous (including an override of makeColumnsAndRows), the vertical scroll resetting stopped working. I've spent about 90 minutes trying to get back to where I was (wish the builder was in IntelliJ!).
When it was working, I also tried to add horizontal scroll capturing, and that didn't seem work either. I have 34 columns, the first one is locked. When I captured my position, I saw it was 11. Then i performed the update, and callLater my resetScroll position. The first column i saw after the locked column is correct. However, the scroll bar itself is fully left. On the next update I captured a horizontal scroll of zero.