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

322
Views
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
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!