Columnas Variables
Columnas Variables

buenos días, estoy tratando de construir un datatable dinámicamente para lo cual le proveeo los datos mediante ajax pero cuando funciona bien si la consulta devuelve el mismo número de columnas pero cuando estas cambian ya no funciona..
código html
código js
$('#tb_dataConsulta').DataTable().clear().destroy();
$('#tb_dataConsulta').DataTable( { "ajax": { "url": "module/mod/func_rep.php?id_reporte=1&sql="+sql}});
de antemano les agradezco su apoyo
This discussion has been closed.
Answers
Very Good Morning!
If the number of columns returned by ajax changes, then you must dynamically update the columns in the associated table also.
The examples in this section should help. Also, why doesn't it work? Are you seeing errors on the server or the client?
Colin