Initialization Structure

Initialization Structure

jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

When I first started using dataTables some 2-3 years ago I used the following format for initialization...

'bAutoWidth': false,
'bDestroy': true,
'bFilter': false,
'bInfo': false,
'bLengthChange': false,
'bPaginate': true,
'bProcessing': true,
'bServerSide': true,
'bSort': false,
'bVisible': true,

'iDisplayLength': 20,

'oLanguage': { 'oPaginate': { 'sPrevious': 'Prev' } },

I now notice in some of the examples that the following format with double quote is used...

"language": {
        "lengthMenu": "Display _MENU_ records per page",
        "zeroRecords": "Nothing found - sorry",
        "info": "Showing page _PAGE_ of _PAGES_",
        "infoEmpty": "No records available",
        "infoFiltered": "(filtered from _MAX_ total records)"
    }

And also some with just single quotes...

What is the preferred method? Is the second now the standard?

Thanks,
jdadwilson

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin

    Generally, I actually try to use no quotes now - but really in Javascript its just personal preference. Double quotes can be useful it you want it to look more like JSON.

    Allan

  • jdadwilsonjdadwilson Posts: 127Questions: 30Answers: 1

    What about the issue of oLanguage vs language?

    jdadwilson

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓
This discussion has been closed.