{hero}

to$()

Since: DataTables 1.10

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 of primary 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 an 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 to$()

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 = $('#example').DataTable();

table
	.column( 0 )
	.nodes()
	.to$()
	.addClass( 'ready' );