Display the number of records in length menu
Display the number of records in length menu

How can i insert the number of records as an option in the lengthMenu.
e.g if there are 15 records show 15 as an available option in the lengthMenu.
lengthMenu': [[8, -1], [8, 15]]
This discussion has been closed.
Answers
I don't believe there is a built in way to dynamically set the length values based on the number of rows. You could use a little jQuery magic to update the lengthMenu in
initComplete
to change valueAll
, for example, to the number of rows. Use thepage.info()
to get the total number of rows.Kevin