0

I'm struggling to get DataTables to display the same pagination behaviour on initial load as when a user selects a number of results per page. When first rendered to screen it looks ok, with e.g. 25 results on the page, but on clicking another page number it goes from e.g.

"Showing 1 to 025 of 301 entries"

To:

Showing 26 to 301 of 301 entries

So rather than showing just the next 25 results on page 2 it's showing ALL those except the first 25. If I choose a number of rows per page from the drop down menu this behaviour corrects itself and I see the 25 results per page I'd expect.

I've had a good look around and for all I can tell the option that should sort this is e.g.:

pageLength: "25"

But I'm using this already. Please see JSFiddle: https://jsfiddle.net/Ly4qnfs5/4/

Thanks for any help.

1 Answer 1

1

Just remove the quotes from pageLength: 25 making it a number (and not a string)

https://jsfiddle.net/Ly4qnfs5/5/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.