Prev / Next Navigation: Need help

Hello,

Here is my feature contribution https://discuss.frappe.io/t/feature-navigating-to-previous-and-next-record/30146

I am facing some issues while doing it,

  1. How to handle filters that are applied on list view to form , how do i manage to navigate the doc while same as per list view.
2 Likes

I think we are trying to over complicate this since next and previous would be applied when you are inside the document say for eg: SINV - 00005, I think in the initial release maybe you should just base it on name field in the db, so next would be name + 1 and previous would be name - 1 in this case.

I am not too knowledgable on this subject but maybe other community members who know more about it can comment with their suggestions.

1 Like

I think it should be based on the filters on the listview. We had this feature at some point, so if I am browsing open issues, I should go to the next open issue and not the next closed one?

2 Likes

Hi, Guess all filtered docs are available in frappe.views.list_view you need to iterate in them and trigger more event when you reach the end. Will try sometime and update. Not sure if there are others working on this.
Thanks

1 Like

yes, Exactly that’s how I want to do it!