aLengthMenu Number Formatting Issue

aLengthMenu Number Formatting Issue

hrosshross Posts: 2Questions: 0Answers: 0
edited August 2010 in Bug reports
First, DataTables is awesome. We are using it in a number of ways. 1.7.1 has fixed almost any issues we have had, except one: two character number formatting when using aLengthMenu and greater than 100 table entries.

The _END_ portion of the sInfo string seems to be formatted for 3 digits even when there are only two.

For instance, when I add the following to my datatables initialization:

"aLengthMenu": [50, 100, 250]

and I have 554 entries, I see the following at the bottom of my table when it is loaded:

Showing 1 to 050 of 554 entries

This isn't a huge deal, but it would be nice to see 50 instead of 050. This happens in IE 7 and Firefox 3 (and presumably other browsers).

Thanks!

Ross

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Hi Ross,

    Do you have something like this in your initialisation object: "iDisplayLength": "50"?

    If so, take the quotes off, and make the number just an integer, rather than a string. Hopefully that will do it for you.

    Allan
  • hrosshross Posts: 2Questions: 0Answers: 0
    You got it. Awesome! Thanks!
  • luizpericololuizpericolo Posts: 3Questions: 0Answers: 0
    I, on the other hand, am having trouble with aLengthMenu.

    I have a (not) working example right here:

    http://dcc.ufrj.br/~pericolo/tests/testDataTables/test.html

    And the code here. Can anyone help me?

    [code]

    var $jTable = jQuery.noConflict();

    $jTable(document).ready(function() {
    $jTable('#display').dataTable({
    "bInfo": false,
    "iDisplayLength": 4,
    "aLengthMenu":[10,15,20],
    "sPaginationType": "full_numbers",
    "oLanguage": {
    "sProcessing": "Processando...",
    "sLengthMenu": "Mostrar _MENU_ registros",
    "sZeroRecords": "N
This discussion has been closed.