Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

324
Vistas
Unable to open modal using custom Datatable buttons

Currently I'm using Datatable library to fill up my table with data. Before I had this button which would open a modal showing the item you have selected which looked like this:

<a title="Send to Whatsapp" id="btnSendWatsap" onclick="sendToWhatsap();" class="btn-custom" data-plugin="custommodal" href="#whatsappmodal">Send to WhatsApp</a>

Now I have added the Datatable.buttons library for exporting my data to Excel sheet which works fine, but for some reason that disabled the modal button. So I decided to make the custom button for this inside the datatable buttons array which looks like this:

  buttons: [
          {
              extend: 'excelHtml5',
              exportOptions: {
                  columns: ':visible'
              }
          },
          'colvis',
          {
            text: 'Send to watsapp',
            action: function ( e, dt, node, config ) {
              sendToWhatsap();
            },
        }              
    ],

So now the sendToWhatsap function is triggered and I do get a response, but the modal is never opened. I've tried adding an href inside href="#whatsappmodal" but this didn't work either.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda