Best way to implement <next>, <prev> element links from search list

倾然丶 夕夏残阳落幕 提交于 2019-12-24 10:56:47

问题


In my web application I got a search results list (SR). The search is heavily parametrized. Each element on the list can be clicked and then the element's own page (EP) is displayed.

Now, the customer wants to have the ability to go to previous and next element from the search list that was used to enter the element page.

How would you implement this? I can either pass the search conditions to the EP and the element's index on the list, then prev/next would just mean to rerun the search query, get previous / next index and display it (still passing the conditions and new index).

Or is there a better approach?


回答1:


How intensive is your search process? It sounds like something you don't want to execute anymore than necessary. What if you when you render the search results you also store in a list the unqiue EP IDs on the server. You can then navigate through that using indexes for prev/next and the unique ID of the EP element to load details? You can then also store the query term and repopulate the search results with a 'Back to Search' link?



来源:https://stackoverflow.com/questions/2131698/best-way-to-implement-next-prev-element-links-from-search-list

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!