This is a migrated thread and some comments may be shown as answers.

How to scroll listview to top?

2 Answers 117 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jan-Dirk
Top achievements
Rank 1
Jan-Dirk asked on 30 Dec 2012, 10:27 PM
I feel stupid that I have to ask a similar question to my earlier question here, but I hope someone can help. I have wasted valuable family time to get this working. I even had no success making a jsbin example for it (kendo ui seems not to be applied to the style): http://jsbin.com/amijij/2/edit

Edit: I found a jsfiddle with which I can demonstrate what is happening here: http://jsfiddle.net/NuyuV/2/

My app consist of 2 pages (Kendo UI mobile views). The first view shows a listview with categories. When a user clicks an item in the list, a listview on the 2nd page is being populated with items in the selected category and then the 2nd page is shown (through an app.navigate). So far this is working well.

However, when the user has arrived on the 2nd page and follows these steps (follow the steps in this fiddle):
- scroll down
- go back to first page with categories
- click the same category again

Then the listview is populated again, but not showing the first item, but the item that was visible when he left the 2nd page. If don't click the same category, but one with just enough items so that scrolling is not possible then you don't even see the items on the page.

I would be happy to post more information if needed!

Thank you in advance

2 Answers, 1 is accepted

Sort by
0
Jan-Dirk
Top achievements
Rank 1
answered on 01 Jan 2013, 04:49 PM
I have modified my post today after I found a jsfiddle that demonstrates the problem.
0
Jan-Dirk
Top achievements
Rank 1
answered on 02 Jan 2013, 05:24 PM
I solved with help from someone on the Google Phonegap group.

The issue was that I was using a data-init method in the listview, instead of a data-show method. The latter is called every time a page is selected.

The code is now like this: http://jsfiddle.net/6PEMa/1/
Tags
General Discussions
Asked by
Jan-Dirk
Top achievements
Rank 1
Answers by
Jan-Dirk
Top achievements
Rank 1
Share this question
or