I have a table
| column 1 | column 2 | colum 3 | [buttons] |
|---|---|---|---|
| data | data | data | [Button][Button][Button][Button] |
I then convert the HTML Table to a responsive datatable, with the buttons bound using a jQuery selector using the .on('click',fuction () {} ); construct. Now in tables that have not been collapsed due to the length of the table row the events are bound, but where datatables have been wrapped the events are not being bound.
It does not matter if I bind the events before or after the creation of the datatable, yet if I specifically bind to a button it works.
This is how I am binding the buttons, all the other buttons that match the selector are bond:
$('button[data-eh-location]').on('click', function () { alert('Wibble'); };
This is the thing I have noticed with the datatabe in that you have to bind things and create tooltips BEFORE your convert the HTLML table to a data table. But in this case it does not seem to be working
How a button is defined in the HTML:
<button type="button" data-eh-location="/@item.UniqueRefenceForLinks/Edit" class="btn btn-edit" title="Edit job application" data-bs-toggle="tooltip"><i class="fa-solid fa-pen-line fa-fw"></i></button>
If the table does not wrap the button is bound correctly