Whether preDrawCallback really support the json parameter?

Whether preDrawCallback really support the json parameter?

hypohypo Posts: 1Questions: 1Answers: 0

the doc[1] shows preDrawCallback has a json parameter function preDrawCallback( settings, json ), but it's always undefined when i use it (i'm using ajax data source) and it looks only accept settings parameter in source code[2].

[1] http://datatables.net/reference/option/preDrawCallback

[2] https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L10283

This question has an accepted answers - jump to answer

Answers

  • rnduserrnduser Posts: 2Questions: 1Answers: 0

    I'm having similar issue. I'd like to check the json and do external event if the recordsTotal in json is 0. Currently, I'm using infoCallback which I really don't think is the right way to do it. And also it some how clashes with sInfo text and doesn't display the sInfo text.

  • allanallan Posts: 61,723Questions: 1Answers: 10,108 Site admin
    Answer ✓

    Thanks for pointing this out. preDrawCallback can't pass in the JSON as the Ajax call hasn't been made at the point of execution for that callback. The docs are wrong there - apologies. I've just committed the fix and will publish in the site shortly.

    Allan

This discussion has been closed.