Initialization Structure
Initialization Structure
jdadwilson
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
This discussion has been closed.
Answers
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
What about the issue of oLanguage vs language?
jdadwilson
See the feature notes for the 1.10 release.
Allan