0

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?

1 Answer 1

1

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

var api = new $.fn.dataTable.Api( settings );
$(api.table().node()).addClass('highlight');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.