Number of rows to display not working

Number of rows to display not working

keyrochekeyroche Posts: 4Questions: 0Answers: 0
edited December 2010 in Bug reports
Hello,
I have set my code for the DataTables initialization sets the number of rows to show as 5, 20, 30, 40, 50 in the selection, as seen below:
[code]"sLengthMenu": 'Display '+
'5'+
'20'+
'30'+
'40'+
'50'+
'All'+
' records',[/code]
I have 6 records in this particular table. With my thinking, it should show 5 of them since the first option is 5, but it shows all 6 records. If you select another number it changes to show that number, and it you go back to click on the 5 it works, but it does not show 5 to start with.

Is there a separate parameter to set up for the starting number of records to show?

Thank you,
Key Roche'

Replies

  • keyrochekeyroche Posts: 4Questions: 0Answers: 0
    Never mind, I figured it out. I have to use the "iDisplayLength" param when initializing it.
  • starwebstarweb Posts: 2Questions: 0Answers: 0
    I'm having this same problem even though I'm using the "iDisplayLength" param. Anyone have any idea on why this isn't working?

    Here is my initialization

    [code]

    $(document).ready(function() {
    $('#example').dataTable({
    "iDisplayLength": 10,
    "aaSorting": [[2,"DESC" ]]
    });
    } );

    [/code]
This discussion has been closed.