0
I’m working on an implementation of Datatables, but the need arose to send id to make filters:
$(document).ready(function() {
var dataTable = $('#employee-grid').DataTable( {
responsive: false,
"order": [[ 1, "asc" ]],
"aoColumns": [
null,
null,
null,
null
],
//"scrollY": 400,
"scrollX": true,
"iDisplayLength": 100,
"processing": true,
"serverSide": true,
"ajax":{
url :"../php/admin_gerente_cidade.php",
type: "post",
error: function(){
$(".employee-grid-error").html("");
$("#employee-grid").append('<tbody class="employee-grid-error"><tr><th colspan="3">Nenhum resultado encontrado</th></tr></tbody>');
$("#employee-grid_processing").css("display","none");
}
}
} );
} );
If I put
url :"../php/admin_gerente_cidade.php?id=<?php $id; ?>"
Doesn’t work.
It would be possible to pass an id via POST?
you need to pass the date: {id: id}
– Rafael Augusto
I’m not very familiar with php, but where the $id is, how is it not string interpolation (because of the <?php ? >, give an echo before the $id and see if it resolves.
– Grupo CDS Informática