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

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

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()
//r
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.



Got any datatables Question?