Proper syntax for applying DataTables

Proper syntax for applying DataTables

joellerjoeller Posts: 48Questions: 9Answers: 0

Hi guys;
I am puzzled. When I first started using DataTables 11 months ago this was the proper format for applying datatables to a table
$('#tblContractLines').dataTable({
"aaSorting": []
});
However Now I am seeing in the examples:
sometimes the previous usages and at other times

$('#example').DataTable();

My code has been working since February. So I am curious, given that JavaScript is case-sensitive which one is the valid syntax.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    Answer ✓

    So I am curious, given that JavaScript is case-sensitive which one is the valid syntax.

    Both! :-)

    From the FAQs:

    The form $().dataTable() will return a jQuery object, while $().DataTable() returns a DataTables API instance. Please see the API documentation for further information.

    Allan

This discussion has been closed.