Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pageSize not working #67

Closed
ghost opened this issue Jul 6, 2018 · 2 comments
Closed

pageSize not working #67

ghost opened this issue Jul 6, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 6, 2018

I set it to custom number, but it's shows me all data from my JSON file
my code:

var container = $('#list');
container.pagination({
    dataSource: './db.json',
    locator: "data",
    pageSize: 3,
    totalNumberLocator: function(response) {
      return response.data.length
    },
    callback: function(data, pagination) {
        var html = '<ul>';
        $.each(data, function(key, value) {
            html += `<li>${value.title}</li>
            `
        })
        html += '</ul>';
        container.prev().html(html);
    }
})
@TommasoSangiorgio
Copy link

Why is this closed? Still not working. Having the same issue

@TommasoSangiorgio
Copy link

I solved this by calling dataSource with getJSON or Ajax.

Example

jQuery.getJSON('https://******.it/query/filtering?type=value', function(d) { data(d); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants