Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

323
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda