How to receive data from server sending a variable for GET php
How to receive data from server sending a variable for GET php
tom_hernandez
Posts: 4Questions: 2Answers: 0
Hi good day My name is Tom from México and I really like DataTables is great... well I have the next function ..
function cargaArtCotizacion(cc){
$('#tableAS').dataTable({
"sPaginationType":"two_button",
"sScrollY": 200,
"sScrollX": "100%",
"sScrollXInner": "110%",
"bScrollCollapse": true,
"bAutoWidth": false,
"oLanguage": {
"sZeroRecords": "Sin resultado",
"sInfoFiltered": "(filtrado de _MAX_ total registros)",
"sSearch":"Buscar",
"oPaginate": {
"sNext": "Siguiente",
"sPrevious": "Anterior"
}
},
"bProcessing": true,
"bServerSide": true,
"iDisplayLength": 50,
"sAjaxSource": "../includes/consultaMobiliario.php?cc="+cc,
"aoColumns": [
{ "mData": "almacen" },
{ "mData": "material" },
{ "mData": "tipo_movimiento" },
{ "mData": "centro_costos" },
{ "mData": "fecha" },
{ "mData": "autor" },
{ "mData": "cantidad" },
{ "mData": "costo" },
{ "mData": "um" },
{ "mData": "nDE" },
{ "mData": "dE" },
{ "mData": "subtotal" },
{ "mData": "iva" },
{ "mData": "total" },
{ "mData": "descripcion"}
]
} );
}
I call this function on click event button and Im trying to take a "id" button to send as parameter to the function
cargaArtCotizacion(cc) and next just add it on this way:
"sAjaxSource": "../includes/consultaMobiliario.php?cc="+cc,
to receive it on php and make a query but it's working for first time but when a clicked another button take the new "id" button
and receive it on php but the dataTable don't change with the new data
function cargaArtCotizacion(cc){
$('#tableAS').dataTable({
"sPaginationType":"two_button",
"sScrollY": 200,
"sScrollX": "100%",
"sScrollXInner": "110%",
"bScrollCollapse": true,
"bAutoWidth": false,
"oLanguage": {
"sZeroRecords": "Sin resultado",
"sInfoFiltered": "(filtrado de _MAX_ total registros)",
"sSearch":"Buscar",
"oPaginate": {
"sNext": "Siguiente",
"sPrevious": "Anterior"
}
},
"bProcessing": true,
"bServerSide": true,
"iDisplayLength": 50,
"sAjaxSource": "../includes/consultaMobiliario.php?cc="+cc,
"aoColumns": [
{ "mData": "almacen" },
{ "mData": "material" },
{ "mData": "tipo_movimiento" },
{ "mData": "centro_costos" },
{ "mData": "fecha" },
{ "mData": "autor" },
{ "mData": "cantidad" },
{ "mData": "costo" },
{ "mData": "um" },
{ "mData": "nDE" },
{ "mData": "dE" },
{ "mData": "subtotal" },
{ "mData": "iva" },
{ "mData": "total" },
{ "mData": "descripcion"}
]
} );
}
I call this function on click event button and Im trying to take a "id" button to send as parameter to the function
cargaArtCotizacion(cc) and next just add it on this way:
"sAjaxSource": "../includes/consultaMobiliario.php?cc="+cc,
to receive it on php and make a query but it's working for first time but when a clicked another button take the new "id" button
and receive it on php but the dataTable don't change with the new data
This discussion has been closed.