toJQuery()
Convert the API instance to a jQuery object, with the objects from the instance's result set in the jQuery result set.
Description
This method will create a jQuery object from the contents of the API instance's result set. This is primarily of use when working with the nodes()
functions of the API such as rows().nodes()
, column().nodes()
and cells().nodes()
, where it can be useful to easily convert the API instance into a jQuery object, working with the nodes using the chaining methods provided by jQuery.
Please note that to$()
and toJQuery()
are identical in functionality. Both methods are provided to cater for the two common forms of how jQuery is used.
Type
function toJQuery()
- Description:
Create a jQuery object from an API instance.
- Returns:
jQuery object which contains the values from the API instance's result set.
Example
Add a class to a specific column in the DataTable:
var table = new DataTable('#myTable');
table
.column(0)
.nodes()
.toJQuery()
.addClass('ready');