Set default value for the length menu and the number of records displayed

Set default value for the length menu and the number of records displayed

robinsfrobinsf Posts: 3Questions: 0Answers: 0
edited May 2011 in General
Using the initial set up, 10 records are displayed and the length menu displays 10. I'd like to display 25 records when the table is first displayed. How do I initialize the default values for (1) the number of rows displayed and (2) the value displayed in the length menu?

thanks in advance

Replies

  • robinsfrobinsf Posts: 3Questions: 0Answers: 0
    I tried the following but no luck:

    [code]
    $(document).ready(function() {
    var tableOptions = {
    "fnRecordsDisplay":"25",
    "fnRecordsTotal":"25"
    };

    $('#tbldatatable').dataTable(tableOptions);
    } );
    [/code]
  • allanallan Posts: 63,515Questions: 1Answers: 10,472 Site admin
    http://datatables.net/usage/options#iDisplayLength :-)

    Allan
  • robinsfrobinsf Posts: 3Questions: 0Answers: 0
    Worked perfect. Thanks Allan.
This discussion has been closed.