Server side and SSP:complex
Server side and SSP:complex
Hello
I have a page with a request diplayed in Datatables with serverside option. I would like use where with complex method.
If I use the complex method with serverside = true, I have an error
DataTables warning: table id=ora_instance - Ajax error. For more information about this error, please see http://datatables.net/tn/7
The page displays fine but when I do a search in input, i have this error.
If I use the complex method with serverside = false, it works
This is a part of my code :
$(document).ready(function() {
var table = $('#test').DataTable( {
"processing": true,
"serverSide": true,
"deferRender": true,
"ajax": "test_req.php",
"dom": 'lBfrtip',
"buttons": [
{
extend: 'collection',
text: 'Exporter les données ',
buttons: [
'copy',
'excel',
'csv',
'pdf',
'print'
]
}
]
} );
// Setup - add a text input to each footer cell
$('#ora_instance tfoot th').each( function () {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="'+title+'" />' );
} );
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
} );
$where = "status='test'";
echo json_encode(
SSP::complex( $_GET, $sql_details, $table, $primaryKey, $columns, null, $where )
);
Thank you
This question has an accepted answers - jump to answer
Answers
For information, I use ssp.class.php that I updated for postgresql
ssp.class.pgsql.php
Maybe it is my probleme?
Thank you for help
It works!!!
We have replace in the complex method to
by
I posted on the github
https://gist.github.com/carosim/42f7ba47f81c39c753bfd210772b9bdc
Thanks for the updates - great to hear you've got it working now.
Allan