itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help with pagination needed

bellerophons-pegasus opened this issue · comments

Hi @cigolpl,

you have created an awesome library!

I am trying to adapt it for a bibliography list and currently am stuck at how to paginate through the items. While looking around I also noticed that the example you provided on jsfiddle does not provide pagination. There a 100 search results are mentioned, but only the first 12 items can be seen.

What am I missing?

Hey @bellerophons-pegasus thanks! This demo is quite limited. It's lacking i.e. pagination.
I was using in other Vue.js & ItemsJS projects something like this to make pagination:

<div class="pagination-bar text-center">
  <paginate
     :page-count="Math.ceil(searchResult.pagination.total / searchResult.pagination.per_page)"
     :click-handler="goToPage"
     :prev-text="'Prev'"
     :next-text="'Next'"
     :container-class="'pagination'">
  </paginate>
</div>

and also Vue.component('paginate', VuejsPaginate). Of course you need to set up your Vue.js variables / functions like goToPage or searchResult

When I have more time I'll try to update this demo. So far good luck with bibliography list

Thank you! I'll fiddle around a bit and will let you know, when I managed it.

Hi again,

I've finally managed it an can now page through my bibliography page!
I forked your example on jsfiddle and expanded it. Thanks again.

Looks good! I've added your jsfiddle example to demo page (https://github.com/itemsapi/itemsjs/edit/master/docs/demo.md)