Get all entries
Get all entries
Hi,
It would be great if there was an option for getting all entries displayed at once. Ie, just another option in the dropdown stating 'all' that disables the pagination. Possibly also some configuration option to control if it should be enabled/disabled.
It would be great if there was an option for getting all entries displayed at once. Ie, just another option in the dropdown stating 'all' that disables the pagination. Possibly also some configuration option to control if it should be enabled/disabled.
This discussion has been closed.
Replies
You can add this option using the oLanguage.sLengthMenu initialisation parameter:
[code]
$(document).ready(function() {
$('#example').dataTable( {
"oLanguage": {
"sLengthMenu": 'Display '+
'10'+
'25'+
'50'+
'All'+
' records'
}
} );
} );
[/code]
You will of course see that it isn't strictly all parameters (it would fall over after 100'000 records, at which point just add another 9...), but this is certainly the easiest way to add this option :-).
Allan
Thanks for the quick fix.
I think it would be nice if dataTabkes actually supported fetching _all_ entries even so. Ie, on value -1 retrieve all entries/disable pagination.
That said, I sure hope I don't ever have to see a table with 100000 records though!
I agree - there might indeed be an easy way of doing this (although I'll probably leave it off by default though incase people do have very long tables, to be overridden like the example above). I'll see if I can include this in the next beta.
Allan
Thanks! I don't mind it being turned off by default, I actually agree on that point! Just as long as there is an option to turn it on for those few cases where I actually need it. I'll stick with your quickfix while I eagerly await the next beta. Keep up the good work! :-)
Took me a bit to find the page, but eventually I did. Thank you for adding this!
Cheers,
CHgsd