How to display only a given number of lines, without pagination
How to display only a given number of lines, without pagination
traroth
Posts: 5Questions: 2Answers: 0
I have a query returning about 2000 lines which I want to display in a DataTable. But I want display only the first 100, without any pagination. How could I do that?
When I use iDisplayLength=100, I get a pagination, of course. When I add bPaginate=false, it displays all the lines, regardless to the value of iDisplayLength...
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
From the legacy documentation
So that is working correctly, if you turn off pagination it ignores iDisplayLength since that is only supposed to work when you have pagination turned on.
That being said there is an easy way to turn it off, and it requires pagination to be on. When you declare the 'sDom' arugment just leave the 'P' off (IE "sDom":"lfrti"). If you decide that you want to also turn off the information ('showing x records of y out of z') than also take off the i. More information can be found at http://legacy.datatables.net/ref towards the bottom under sDom.
Thank you, it perfectly resolved my issue.