Hello, I'm using table.api().draw() to read new data through ajax for a table. But this function does not call initComplete again. How to force a table to completely redraw with an initComplete call?
initComplete runs only once after the Datatable has initialized. You will need to move the code to a more appropriate event so it runs when desired. The draw event may work for your needs.
Thanks, I'm using initComplete because I need the data received from the server via ajax initComplete(settings, json). Can you suggest what other event can accept the same input data?
The xhr event has a json parameter. You can also use the ajax.json() API to read the current JSON data.
If you use ajax.reload() to reload the table you can use the callback to access the data read from the server.
json.data is the array with the rows read from the server if you use Editor.
It looks like you're new here. If you want to get involved, click one of these buttons!
DataTables designed and created by SpryMedia Ltd.
SpryMedia Ltd is registered in Scotland, company no. SC456502.