문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top