datatables and bootscrap - get id row clicked

datatables and bootscrap - get id row clicked

gladsonreisgladsonreis Posts: 12Questions: 0Answers: 0
edited April 2014 in General
Hello! I'm sorry because my english is not the best ...
I'm using bootscrap with table and I need to get the record ID
I'm clicking.

Thanks

Replies

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin
    edited April 2014
    Hi,

    You can use a little bit of jQuery if the row has an `id` attribute:

    [code]
    $('#myTable').on( 'click', 'tbody tr', function () {
    alert( 'Clicked on row id: '+this.id );
    } );
    [/code]

    Allan
This discussion has been closed.