Reputation: 6493
I'm trying to use this dataTable javascript library in my Rails 4 project. I'm using this rails gem to install the javascript library for convenience.
The problem is that no initialisation options are working. For example:
$('.datatable').dataTable({
pageLength: 50
});
This should let there be 50 visible records as default at initialisation, however 10 is still the default. No other options are working ether.
Any hint, or help is appreciated! :)
Upvotes: 2
Views: 812
Reputation: 11665
The option you're looking for is iDisplayLength.
From the documentation:
iDisplayLength - Number of rows to display on a single page when using pagination.
Code:
$('.datatable').dataTable({
"iDisplayLength": 50
});
Upvotes: 2