Bug when changing pageLength from 0 to something else

Bug when changing pageLength from 0 to something else

EliottgsnEliottgsn Posts: 2Questions: 0Answers: 0
edited July 16 in Free community support

Hello, I've recently been playing a bit with datatables, and I've noticed that when you set pageLength to 0 and then change it to another it just stops showing rows.
Here's my configuration :

$('#testTable').DataTable({
      lengthChange: true,
      lengthMenu: [0, 10, 20, 50, 100],
      pageLength: 10
});

ps. If you set default pageLength to 0 and then change it to smth else it works

Replies

  • kthorngrenkthorngren Posts: 21,327Questions: 26Answers: 4,949

    I built a test case for you:
    https://live.datatables.net/kefasazu/1/edit

    It behaves as you say. @allan will need to take a look.

    Kevin

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

    I never expected the page length to be set to 0, and thus have never tested it. What's the use case? I might add a note to the reference documentation stating that it should never be less than 1.

    Allan

  • EliottgsnEliottgsn Posts: 2Questions: 0Answers: 0

    Thanks for answering, I wanted to have a table that only shows rows when applying filters from filterPanes

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

    You could just hide the table, rather than changing the page length? Set its container to be display: none.

    Allan

Sign In or Register to comment.