superRaytin / paginationjs

A jQuery plugin to provide simple yet fully customisable pagination.
http://pagination.js.org
MIT License
912 stars 659 forks source link

PageSize is not working with ajax method #134

Closed TommasoSangiorgio closed 1 year ago

TommasoSangiorgio commented 1 year ago

When I use ajax method my application outputs all the data, the same on every page.

This only happens when calling jSONs

TommasoSangiorgio commented 1 year ago

Solved this.

I was looking at the webiste Docs under "Asynchronous or JSONP", even there the pageSize is not working. In the docs it suggests to call data directly via url dataSource: 'https://api.flickr.com/services/feeds/photos_public.gne?tags=cat&tagmode=any&format=json&jsoncallback=?'

What I did is to call data in a function with an ajax call or with getJSON

dataSource: function(done){
    $.ajax({
        type: 'GET',
        url: '/test.json',
        success: function(response){
            done(response);
        }
    });
}