Problem button click function jquery with datatables bootstrap

0

I have a table more or less like that. In the delete button I have a class that I use to delete the record from ajax. The code of the table in a simplified way is the following:

<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" id="mytable">
    <thead>
        <tr>
            <th>#</th>
            <th>Título</th>
            <th>Publicado</th>
            <th>Vencimiento</th>
            <th>Estado</th>
            <th>Visitas Únicas</th>
            <th>Editar</th>
            <th>Eliminar</th>
        </tr>
    </thead>
    <tbody>
        <td>
            <tr>1</tr>
            <tr>Título1</tr>
            <tr>2018-08-20</tr>
            <tr>2018-09-20</tr>
            <tr>Activa</tr>
            <tr>6</tr>
            <td><a href="htt://sitioweb.com/a"><button class="btn btn-info">Editar</button></a></td>
            <td><button class="btn btn-danger eliminar"  id="785">Eliminar</button> </td>
        </td>
        <td>
            <tr>2</tr>
            <tr>Título2</tr>
            <tr>2018-08-22</tr>
            <tr>2018-09-23</tr>
            <tr>Activa</tr>
            <tr>5</tr>
            <td><a href="htt://sitioweb.com/a"><button class="btn btn-info">Editar</button></a></td>
            <td><button class="btn btn-danger eliminar"  id="786">Eliminar</button> </td>
        </td>
    </tbody>
</table>

Everything works wonderfully (apparently), the drawback is that the "delete" button only works for the first page, starting on page 2, clicking the buttons does not trigger my jquery code :( what worse is that from the console does not send me any error, just does not respond, plus I already reviewed the code and the plugin is not adding any additional code >.

The plugin URL that I am using is: link

    
asked by Neftali Acosta 04.09.2018 в 23:00
source

1 answer

0

Excuse me, the important thing about having the English version of stackoverflow

link

$("#tableId").on("click", ".activeAccount", function(){
   // your code goes here
});
    
answered by 04.09.2018 в 23:10