sLengthMenu doesn't update the default string

sLengthMenu doesn't update the default string

nrapnrap Posts: 2Questions: 0Answers: 0
edited June 2011 in DataTables 1.8
Hello everyone,

I have this problem that is driving me mad! We were asked to Internationalise everything in our web application and we also have to internationalise datatables.. Although sFirst/sLast etc work flawlessly, I cannot change the sLengthMenu..
It always returns the same value: Show [10] entries

Below is my code.. Any ideas would be greatly appreciated!!!
Cheers
Nick

$(document).ready(function(){
var oTable = $('#resultsTable').dataTable(
{ "bLengthChange": true, "bFilter": false,
"bSort": true, "bInfo": false, "bAutoWidth": true, "bJQueryUI": true,
"sPaginationType": "full_numbers", "bProcessing": false,
"oLanguage": {
"oPaginate": {
"sLengthMenu": 'sDisplay _MENU_ records per page',
"sFirst": 'eFirst padge',
"sLast": 'dLast pagde',
"sNext": 'cNext pagde',
"sPrevious": 'bPrevdious page'
}
}
}
);
});

Replies

  • nrapnrap Posts: 2Questions: 0Answers: 0
    Never mind.. I've figured it out..

    I should have had the sLengthMenu outside the oPaginate...i.e.

    { "bLengthChange": true, "bFilter": false,
    "bSort": true, "bInfo": false, "bAutoWidth": true, "bJQueryUI": true,
    "sPaginationType": "full_numbers", "bProcessing": false,
    "oLanguage": {
    "sLengthMenu": ' "Records per Page") _MENU_ ',
    "oPaginate": {
    "sFirst": 'First Page',
    "sLast": 'Last Page',
    "sNext": 'Next Page',
    "sPrevious": 'Previous Page'
    }
    }
    }
    Thanks for the great tool!!! :)
This discussion has been closed.