language.pageLength doesn't seem to work (v2.0.1)?

language.pageLength doesn't seem to work (v2.0.1)?

RStewartRStewart Posts: 7Questions: 3Answers: 0

I'm in the process of updating to v2.x from v1.13.x and working through some of the API changes and figuring out how to take advantage of some of what v2.x brings.

I'm trying to change the wording of the text for the page length control. The reference page for pageLength.text (https://datatables.net/reference/feature/pageLength.text) refers to language.pageLength and has links to https://datatables.net/reference/option/language.pageLength which all generate 404 errors.

I would expect (perhaps incorrectly?) for something like the following to work in initializing the DataTable object but it does not:

...
language : { pageLength : "Show _MENU_ articles per page" }
...

The default wording for the page length control remains in place.

I can work around this with the following initialization:

...
layout : {
topStart : { pageLength : { text : "Show _MENU_ articles per page" } }
}
...

... but it feels like there's a gap in both the implementation and in the reference manual? Or am I interpreting the information in the reference manual incorrectly?

Ron

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited February 29 Answer ✓

    Hi Ron,

    No - that one is a bug. Apologies! What you have with language.pageLength should indeed work. I'll post back with a fix soon (tomorrow morning probably).

    Allan

  • RStewartRStewart Posts: 7Questions: 3Answers: 0

    Thanks for both the quick response, Allan! Incredible support, as always.

    Ron

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I've worked out what was going wrong - I used the wrong property name in the documentation for pageLength.text. It should have been pointing at language.lengthMenu, not language.pageLength (which doesn't exist!).

    Sorry about that!

    Allan

Sign In or Register to comment.