[solved] pageLength language with '-1' as javascript object key/property name?

[solved] pageLength language with '-1' as javascript object key/property name?

CodeBrauerCodeBrauer Posts: 2Questions: 1Answers: 0
edited May 2017 in Free community support

In the 3rd example of this https://datatables.net/reference/button/pageLength:

$('#myTable').DataTable( {
    dom: 'Bfrtip',
    language: {
        buttons: {
            pageLength: {
                _: "Show %d entries",
                -1: "Show all entries" // « This will not work in JS, right? 
            }
        }
    },
    buttons: [
        'pageLength'
    ]
} );

So how can I translate this?

Answers

  • CodeBrauerCodeBrauer Posts: 2Questions: 1Answers: 0
    edited May 2017

    Javascript is just ****

    works: '-1': "Alle Einträge anzeigen" - (property as a string)

  • allanallan Posts: 63,535Questions: 1Answers: 10,475 Site admin

    Good point - it would need to be quoted!

    Fix for the docs committed and I'll push it out to the site soon.

    Regards,
    Allan

This discussion has been closed.