Obtain the DT API instance from initComplete.
Obtain the DT API instance from initComplete.
washuit-iamm
Posts: 136Questions: 57Answers: 2
Is this right?
initComplete: function (settings, json) {
var self = this.api();
}
Or do I need to go from settings?
initComplete: function (settings, json) {
var table = settings.oInstance.api();
}
Difference?
(settings.oInstance.api() == this.api()); // FALSE!!!!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @washuit-iamm ,
Yep, use the top one, see example here. As the manual says for
DataTables.Settings, the settings "object is considered to be private in terms of the DataTables API and reading or writing to the values in the object is not supported."Cheers,
Colin