Author |
Message |
24/01/2013 12:38:43
|
bthalheim
Power User
Joined: 05/04/2012 11:45:24
Messages: 72
Offline
|
Hi,
I am using longpolling to Push updated data into a fixgrid in my frontend.
When updating Data in the fixgrid (either changing elements or adding/deleting some), I make sure that the item is sorted into the grid by simply calling
Code:
fixgridListBinding.resort()
Unfortunately, this causes two problems:
Focus is lost.
Selection is lost.
The loss of the selection is no problem, I just need to grab the selectedItems before the resort and then reselect these items.
More interesting is the loss of the Focus. I have meanwhile tried ensureItemToBeDisplayed, but that results on the item being always focussed as the top row of the displayed rows (so if I select a line in the middle then the item and the focus "jumps up").
Does there exist any way to preserve and restore the vertical scroll position of a fixgrid?
Cheers,
Björn
|
|
|
24/01/2013 13:23:15
|
Admin
Power User
Joined: 21/11/2007 11:36:10
Messages: 38
Offline
|
Hi,
yes there is a way:
You receive the current horizontal scroll position by
FIXGRIDBinding.getCurrentHorizontalScrollPosition()
any you can set by
FIXGRIDBinding.scrollHorizontallyToPosition(int value)
Regards, Björn
|
|
|
24/01/2013 13:28:27
|
bthalheim
Power User
Joined: 05/04/2012 11:45:24
Messages: 72
Offline
|
Hi,
unfortunately, this is the horizontal scroll position.
I need the vertical scroll position.
But yes, if there were something like get/setVerticalScrollPosition, that wourd be exactly what I need.
Cheers,
Björn
|
|
|
28/01/2013 13:56:05
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5555
Offline
|
...the vertical scroll position is set by setting setSbvalue(...) - the index of the current top-line of the grid.
Please also check method ensureToBeDisplayed(...) with FIXGRIDBinding.
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
30/01/2013 18:58:54
|
bthalheim
Power User
Joined: 05/04/2012 11:45:24
Messages: 72
Offline
|
Thanks. This does exactly what I want.
I should have known this ...
Björn
|
|
|
|