jquery - How to get JSON in data table fnDrawCallback function? -
how json in fndrawcallback function? send parameter in json , want in fndrawcallback function.
you can access data throught object api.
example, json return:
$output = array( "itotalrecords" => $qty, "itotalinvoicesum" => $totalinvoicesum, "itotalbalancesum" => $totalbalancesum, "itotaldisplayrecords" => $qty, "aadata" => array() ); on callback can this:
"drawcallback": function( settings ) { var api = this.api(); var json = api.ajax.json(); $( api.column( 5 ).footer() ).html( '<b>$ '+json.itotalinvoicesum+'</b>' ); $( api.column( 6 ).footer() ).html( '<b>$ '+json.itotalbalancesum+'</b>' ); }
Your solution helped me with another error. Thank you!
ReplyDelete