datatables Migration from <1.10 to 1.10 and above Initialisation of Datatable 1.10+


Previously, datatables were initialized as follows:

var oTable = $("#selector").dataTable();

This used to return a jQuery object which would stored in the variable oTable. And then to access the api to modify table properties, we had to initialize the api differently, as shown below:

var api = oTable.api()
var api = new $.fn.dataTable.api("#selector")

Now, the initialization is changed to the following:

var table = $("#selector").DataTable();

Note that this returns a datatable api instance and you can directly use variable table to manipulate datatable properties.