table refresh without shown to the user

I have a table which shows some data (minimum of 6 months).
When I press a button I want the table to update the table with all the data, however the user should still remain where they are, rather than been shown the topmost record again.

Can this be done?

Hey Clare,

I tried the following: created a table with 1000 items, scrolled to the middle, added new items and the rows I were viewing stayed in place.

Please elaborate on your setup a little bit more. Are you using push for example, or how is the table updated in the user’s view?

Hi,

if you’re changing the whole container (or emptying and rebuilding it) the scroll position will reset to the top. If your item ID’s stay the same despite the update (excluding added/removed items of course, you could call getCurrentPageFirstItemId() before the update and store the value. After the update you should call setCurrentPageFirstItemId(…) with the stored value. The table should now scroll to the original position.

-tepi

Tepppo - I am changing the whole container, in the sense I am adding new items to the table.And rebuilding the table from scratch.

Joacim - Its a touchkit app when I navigate to the view I see a table with some records (these are transactions shown within 6 months), when I click on the button I want the table to be updated with (all the transactions (may be millions of records) but the user should not be able to notice the update and should stay where they are. There is a database call to get all the records.