Bug when changing pageLength from 0 to something else
Bug when changing pageLength from 0 to something else
Eliottgsn
Posts: 2Questions: 0Answers: 0
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
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
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
Thanks for answering, I wanted to have a table that only shows rows when applying filters from filterPanes
You could just hide the table, rather than changing the page length? Set its container to be
display: none
.Allan