Columnas Variables

Columnas Variables

Hans2020Hans2020 Posts: 1Questions: 1Answers: 0

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

Answers

  • lokesh16lokesh16 Posts: 9Questions: 0Answers: 0

    Very Good Morning!

    If the number of columns returned by ajax changes, then you must dynamically update the columns in the associated table also.

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    The examples in this section should help. Also, why doesn't it work? Are you seeing errors on the server or the client?

    Colin

This discussion has been closed.