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>'                 );             } 

Comments

  1. Your solution helped me with another error. Thank you!

    ReplyDelete

Post a Comment

Popular posts from this blog

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -