Tengo un boton en un Display-types(Semantic UI modal) pero no funciona el onclick

Tengo un boton en un Display-types(Semantic UI modal) pero no funciona el onclick

luis_rubio20luis_rubio20 Posts: 2Questions: 2Answers: 0
edited October 2020 in Free community support
$(document).ready(function() { $('#example').DataTable( { destroy: true, 'ajax' : { 'url' : './listado.php', 'type' : 'post', "dataSrc": "", }, "columns": [ { "data": "nombre" }, { "data": "balance"}, { "defaultContent": ' '} ], responsive: { details: { display: $.fn.dataTable.Responsive.display.modal( { header: function ( row ) { var data = row.data(); return 'Modal'; } } ), renderer: $.fn.dataTable.Responsive.renderer.tableAll() } } } ); } ); var table = $("#exampple")DataTable(); $('#example tbody').on('click', 'a.edit', function () { var data = table.row('tr').data(); alert( 'You clicked on s row' ); });

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 21,303Questions: 26Answers: 4,947
    Answer ✓

    I have a button in a Display-types (Semantic UI modal) but the onclick doesn't work

    I put your code in a test case:
    http://live.datatables.net/ceyuzosi/1/edit

    I added data: null, to this statement to get the element to appear:

    { data: null, "defaultContent": '<a id="edit" class="edit"><i class="far fa-eye"></i> </a>'}
    

    The click event works. If you still have issues please provide a link to your page or a test case showing the issue. You can update my example.

    Kevin

This discussion has been closed.