Can't change/set pageLength?
Can't change/set pageLength?
brybell
Posts: 2Questions: 1Answers: 0
Hello,
I have a table, here www.brybell.me/winelist_visa.html
I just want the table to default to 25 rows showing, but I want the user to still be able to change the number of rows displayed.
I know I need to use 'pageLength' but I can't seem to get it to work. I have tried adding it to my head on the HTML page, but nothing seems to work, it always only shows 10.
This discussion has been closed.
Answers
One way to achieve this is to set the lengthMenu variable in the (document).ready call.
You are attempting to initialise the same DataTable two different ways:
See this section of the manual for how to initialise a table just once, with multiple options.
Allan
Ok thank you. I tried this and it is still not doing anything.
Seems to work for me. The attached image is what I get when I load the page - 25 records shown, per your
pageLength
option.Allan