Datatable issue

Datatable issue

fra91fra91 Posts: 1Questions: 1Answers: 0
edited August 2015 in Free community support

Hi! I'm trying to use datatable but the ajax request returns "Warning: Invalid JSON response". Server response is:
Resource id #4{"draw":1,"recordsTotal":2,"recordsFiltered":2,"data":[[...]]}
I think that the issue is the resource id #4.
Here my array to insert data from database:
$columns = array( array( 'db' => 'a', 'dt' => 0 ), array( 'db' => 'b', 'dt' => 1 ), array( 'db' => 'c', 'dt' => 2 ), array( 'db' => 'd', 'dt' => 3 ), array( 'db' => 'e', 'dt' => 4 ), array( 'db' => 'id', 'dt' => 5 ), array( 'db' => 'f', 'dt' => 6, 'formatter' => function( $d, $row ) { if ($d != null && $d != "") return date( 'd/m/Y', strtotime($d)); else return "Data non presente"; } ), array( 'db' => 'g', 'dt' => 7, 'formatter' => function( $d, $row ) { if ($d != null && $d != "") return date( 'd/m/Y', strtotime($d)); } ) );

This discussion has been closed.