Default value for sLengthMenu

Default value for sLengthMenu

DecebalDecebal Posts: 3Questions: 0Answers: 0
edited August 2009 in General
I use the folowing code:
[code]
"sLengthMenu": 'Toon \
10\
20\
30\
40\
50\
Alles\
records',
[/code]

I would like the Alles (All) value to be the default. But for one reason or another the value 10 is always the default. What is going wrong? How can I make 'Alles' the default?

Replies

  • DecebalDecebal Posts: 3Questions: 0Answers: 0
    I should have looked further. I needed to add:
    [code]"iDisplayLength": -1,[/code]

    So problem solved.
  • Andy NewtonAndy Newton Posts: 1Questions: 0Answers: 0
    Still took me a few attempts to get this to work: this selects 100 by default, change iDisplayLength to 10 or -1 for the other options:

    [code]
    $('#datatable_id').dataTable( {
    "iDisplayLength": 100,
    "oLanguage": {
    "sLengthMenu": 'Display '+
    '10'+
    '100'+
    'All'+
    ' records'
    }
    } );
    [/code]
This discussion has been closed.