Page 2 of 2
Refresh just one item?
Posted: Thu Apr 02, 2015 1:09 am
by Yurii Orishchuk
Hi Ellen,
Here is a code to get and store scroll:
pre
self.storedScrollTop = jQuery(window).scrollTop();
/pre
And here is code to restore scroll from stored value:
pre
jQuery(window).scrollTop(self.storedScrollTop);
/pre
Regards.
Refresh just one item?
Posted: Thu Apr 02, 2015 1:33 am
by Ellen Schlechter
The update service happens on a different page so I tried the first code when you navigate to that page then the second code when I come back to the first page but it didn't work.
Refresh just one item?
Posted: Fri Apr 03, 2015 12:53 am
by Yurii Orishchuk
Hi Ellen,
You need:
On page show(for goal page) store scroll.
On service "complete" event handler - restore scroll.
Regards.
Refresh just one item?
Posted: Fri Apr 03, 2015 2:37 am
by Ellen Schlechter
The problem is with #2. I can't run that code on a service completion that is on a different page.
Refresh just one item?
Posted: Mon Apr 06, 2015 2:57 am
by Yurii Orishchuk
Hi Ellen,
These two things should be done on the one page.
Before invoke service.
After complete service.
Regards.
Refresh just one item?
Posted: Mon Apr 06, 2015 3:25 am
by Ellen Schlechter
I don't think you understand.
A user clicks an item from a very long list and they go to another page. When they come back, I want the scroll position to be in the same spot as it was before. To have it after the service is complete, it could be on the wrong page.
Refresh just one item?
Posted: Mon Apr 06, 2015 11:58 pm
by Yurii Orishchuk
Hi Ellen,
When they comeback - list on the correct position(before you reload it)? Cause of if list not on the same position like on was when you click on item how do you want to reinit just one item?
If your list on the same(goal) position you can implement it in way described above.
Regards.
Refresh just one item?
Posted: Tue Apr 07, 2015 12:13 am
by Ellen Schlechter
I ran the first code when a user clicks on the list item to navigate away. I then ran the second code when the user comes back and it didn't work.