Fabian Gehring
Fabian Gehring

Reputation: 1173

jquery datatable object from settings

I'm using the jQuery DataTables plugin. Within its initComplete callback (which has settings as parameter available) I'm trying to make a jQuery table object.

With the following command (from DataTables.Settings)

var api = new $.fn.dataTable.Api( settings );

it's easily possible to create a (datatables) table object? All attempts to convert it to a jQuery object failed. The jQuery object is needed, since I need it's find method later on.

Is there a way to get a jQuery object form the settings directly. Or if not, can the API be converted to a jQuery one?

Upvotes: 0

Views: 857

Answers (1)

Gyrocode.com
Gyrocode.com

Reputation: 58860

You can use table().node() API method.

var api = new $.fn.dataTable.Api( settings );
$(api.table().node()).addClass('highlight');

Upvotes: 1

Related Questions