Responsive datatable and buttons in the last column
Responsive datatable and buttons in the last column
Hi, I have datatable with buttons(delete/edit) in the last column. I am using responsive table.
When the screen is done small, a button appears in the first column to show the details and my buttons(delete/edit) go to a child row.
When the screen is bigger. I have used the next code in JS to handle the edit/delete buttons:
/ok to big screen/
var btnDel=$('#mytable tbody').on( 'click', 'button.eliminar', function () {
var data=table.row($(this).parents('tr')).data();
var pront=data.pront; // this is my data row id
var row = $(this).closest("tr").get(0); //here is the row containing the clicked button
..other staff
});
Now, when the screen is smaller(with responsive table), this is not working.
How could I do it work to small screen?
Here is the source code when the child is showing:
Pront | Nome | Endereço | Bairro | Cidade | UF | Telefone | Convênio | CPF | Opções | |
---|---|---|---|---|---|---|---|---|---|---|
Pront | Nome | Endereço | Bairro | Cidade | UF | Telefone | Convênio | CPF | Opções | |
21 | JACENI FERRARI ALENCAR | R ARAGUAIA | PARQUE CHUNO | DUQUE DE CAXIAS | RJ | 35637685 | BRADESCO (B) | 02570293709 | jaceni@ig.com.br | |
|
||||||||||
23 | PEDRO HENRIQUES MARTINS SOUZA | rua 18 de outubro 241 101 | tijuca | RIO DE JANEIRO | RJ | CASSI |
Answers