I'm trying to add an "Edit" and "Delete" buttons on each row on a Datatable. When I click on "edit", it calls a controller function and needs to pass the id of that row as argument. I'm having issues doing it right. Any suggestions?
My controller
`
def usuarioUpdate():
return dict(formUsuarioUpdate=crud.update(db.Users,request.args(0)))`
My view
<script>
var tabla;
$(document).ready(function(){
tabla= $('#tablaGenerica').DataTable({
"data": {{=formListar}},
"scrollX": false,
"dom": 'lrtip',
"searching": true,
"sRowSelect": 'single',
"language": {
"url": "{{=URL('static','js/tradutorTable.json')}}",
},
"columns": [
{
"class":"details-control",
"orderable":false,
"data":null,
"defaultContent": ""
},
{ data: 'users.first_name' },
{ data: 'users.last_name' },
{ data: 'users.email' },
{ data: 'users.username' },
{
"orderable":false,
"data":null,
"defaultContent": "<div class='btn-group btn-group-justified JpositionA'><a class='btn btn-success Jview btn-xs' href='{{=URL('Herramientas','usuarioUpdate',args=["users.id"])}}'><span class='glyphicon glyphicon-pencil'></span></a><a class='btn btn-warning Jview btn-xs' href=><span class='glyphicon glyphicon-remove'></span></a></div>",
},
]
});
</script>
<table id="tablaGenerica" class="tablaC table-striped hover cell-border" cellspacing="0" width="100%" >
<thead>
<tr>
<th></th>
<th>Nombre</th>
<th>Apellido</th>
<th>Correo Electrónico</th>
<th>Nombre de Usuario</th>
<th></th>
</tr>
</thead>
</table>