Pagination on View Record
Hello. Has anyone added pagination to View Record page, like "Prev | Next" on the view record?.
I need to be able to search on the List view of a resource, and after I open one of the results I want to be able to move to the previous or next result from the View Record (Infolist) . I guess I would need to pass the filters to the view page in order to be able to build the pagination there. Has anyone attempted this or is it possible?
Thanks.
3 Replies
Ok. I've found that filters of the table can be stored on the session. I guess I need to get those filters and run the query again on the View. But is it possible to reuse the table query without building the query again on the View?
It depends on how your implementing this, but you’d probably need a custom page so you can grab the previous and next records in mount, then pass those to custom actions that you can display on the page. Each with a link to the same route but with a different record id.
You essentially will need to manually create the pagination for this.
Ok. I was able to call the table from the View page using InteractsWithTable and setting a common session name for the table filters. Its looking good so far.
But as a bonus. Do you how to inject the rowLoop within the recordUrl method?