[bug] Number of rows shown not set when providing sScrollY

[bug] Number of rows shown not set when providing sScrollY

koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
edited May 2013 in Bug reports
[code]$('#example').dataTable({"sScrollY": "500px"});[/code]

Expected behavior: +/- 16 rows being shown, as there is enough vertical space
Observed behavior: +/-10 rows being shown

http://live.datatables.net/ayepep/edit#javascript,html,live

Replies

  • psharppsharp Posts: 39Questions: 0Answers: 0
    edited May 2013
    Set "iDisplayLength" to something other than 10.

    i.e.
    [code]
    $(document).ready(function() {
    $('#example').dataTable({"sScrollY": "500px","iDisplayLength":-1});
    } );
    [/code]

    http://live.datatables.net/adobob/3/edit#javascript,html,live
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Or disable paging - bPaginate . The default for paging to be enabled and show 10 records - that's why you are getting 10 records :-)

    Allan
  • koosvdkolkkoosvdkolk Posts: 169Questions: 0Answers: 0
    Thanks!

    [quote]The default for paging to be enabled and show 10 records - that's why you are getting 10 records :-)[/quote]

    Mmm.... doesn't it make sense to calculate the number of rows in the pagination feature, based on the amount of vertical space? I have 1600+ rows, and should paginate.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Possibly yes - pagination could have an 'auto' value that you could set for iDisplayLength . But that doesn't exist at the moment - it is being told to draw 10 records, and thus is, so I think it is correct as the current feature set stands (i.e. the is no bug), but there is a missing feature.

    I'll have a think about how that might be implemented, but it will likely be v1.11 before I can put that in now.

    Allan
This discussion has been closed.