Frage

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! :)

War es hilfreich?

Lösung

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
});

DEMO

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top