I'm wondering if there is an easy way to add a "show all" option in the "show ____ entries" dropdown menu. Right now it shows 25, 50, and 100.
I'm wondering if there is an easy way to add a "show all" option in the "show ____ entries" dropdown menu. Right now it shows 25, 50, and 100.
The closest approach to implement "Show All" option at the moment is by adding the biggest value into the "Show entry" options, for example: 999, afterwards select this value to show all rows in the table.
Here is the trick how to implement it. Hope it helps you.
Hi,
according to the DataTables documentation at http://datatables.net/usage/options#aLengthMenu it is actually possible to add a "All" entry to the dropdown. Just add the code
"aLengthMenu": [[10, 25, 50, -1], [10, 25, 50, "All"]]
to the "Custom Commands" textfield in the "DataTables JavaScript Features" section on the "Edit" screen of your table. Of course you can adjust the entries to other numbers, if needed.
Best wishes,
Tobias
Hi Tobias,
Thanks for pointing it out to us. I have tried it, and it works perfectly. Will update my post by adding that trick, too. :)
Hi,
no problem, you are very welcome! :-)
Best wishes,
Tobias
Hi Tobias and everyone,
Just want to let you know that I have just edited my article in my blog, based on this thread. There is another trick how to change the selected record count or rows in the table, by adding additional code in the "Custom Commands" textfield in the "DataTables JavaScript Features" section on the "Edit" screen of the table. Even this trick will overide the changes I made previously into the core file. ;)
That is the best approach I think, since we don't have to worry losing the modification in the plugin core file anymore (as the solution I wrote previously), after updating this plugin to the latest version in the future.
You can see the link to my article at the second post above. Hope it helps to anyone who need it and read this thread some other time.
Hi,
thanks for the update in the post! Nice writeup!
Best wishes,
Tobias
You must log in to post.