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.