Closed vhanahrni closed 7 years ago
Please consider using data-control-storage="false" attribute: http://jplist.com/documentation/control-settings/pagination
It allows to exclude the pagination control from the storage.
I read the documentation. Using data-control-storage="false" exclude the pagination from the storage. I need to save the pagination to retrieve the state when going back from detail page to result page, and I need to to have pagination jump to start on new search (on form submit). I ask this question as for example : A search's result has 100 items, pagination is set to 10 items per page. I navigate to page 3. Then I make a new search and new search's result has 90 items : the page shown is the third page.
You can try the following JS after a new search:
$('.jplist-pagination [data-number="0"]').eq(0).trigger('click')
Thank you very much for your answer. The final code is below
$("#menu-search-sku").submit(function() {
//pagination jump to start
$('.jplist-pagination [data-number="0"]').eq(0).trigger('click')
});
Other solution is to use your previous answer ( using data-control-storage="false" ) with deep linking.
You're welcome 👍
Hi, thanks for your work.
Is it possible to have pagination jump to start on form submit ?
I use save plugin state. That's great for page reload, but plugin is initiated in a search's result page so each new search's result start from last saved page.