Navigating to Specific Item in ListView and Repeater




How can we navigate within the page or at the top of the page programmatically?



What you mean by navigating within the page? If its about updating part of the page, you got to handle it yourself by adding / removing children from container with NativeScript Core.

If you use Angular, it allows you to use child routers to handle this scenario.


Thanks @manojdcoder for your response. Lets say I have a ListView and I have four buttons which filters this list and shows the changed list on the screen. Whenever I change this list, it doesnt scroll user to top of the page again instead it keeps user at the same location even when the page result is updated. I want user to be table to the top of the page.

Another thing which I want is lets say I want user to be taken to a particular Label with some id, how can I do that?


Please try to create a playground example where we can reproduce your issue.

Besides, when ListView is updated with new data source it should reload, also any time you can scroll to top using .scrollToIndex(0) method


Thanks @manojdcoder. This worked for me.


@manojdcoder For some reason scrollToIndex works fine on one page and when I tried to use at another page it gave me JS ERROR TypeError: optionList.scrollToIndex is not a function. I have created a playground example I am not sure what is missing.


Repeater !== ListView, I have updated you example.

Navigating within a page