EDIT :
I want to create a custom edit / delete function for records I have in a datatable.
In datatable code I have :
$('#users tbody').on( 'click', 'tr', function () {
// get the row id here and send it to button
} );
When a user selects a row I want to get the row ID and send it to a button :
<a href="<?php echo site_url('main/delete/$id')?>" data-toggle="modal" data-target="#deleteModel" role="button" class="btn-u btn-block">Delete</a>
$id (from the button link ) = ID of row selected by user.