Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Advertencia de DataTables: table id={id} - No se puede reiniciar DataTable

Estoy usando tablas de datos y estoy tratando de agregar 'mostrar/ocultar columnas dinámicamente', desde https://datatables.net/examples/api/show_hide.html

En mi página web ya tengo el código este bit de código:

 <script> $(document).ready(function(){ var table = $('#example').DataTable(); //DataTable custom search field $('#custom-filter').keyup( function() { table.search( this.value ).draw(); } ); }); </script>

y ahora quiero agregar

 $(document).ready(function() { var table = $('#example').DataTable( { "scrollY": "200px", "paging": false } ); $('a.toggle-vis').on( 'click', function (e) { e.preventDefault(); // Get the column API object var column = table.column( $(this).attr('data-column') ); // Toggle the visibility column.visible( ! column.visible() ); } ); } );

Pero me sale el error:

 DataTables warning: table id=example - Cannot reinitialise DataTable.

Intenté combinar los dos en uno, pero sigo recibiendo el error. Cualquier ayuda sería apreciada.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!