td.details-control open an other table
td.details-control open an other table
erickmt
Posts: 15Questions: 3Answers: 1
I created a column td.details-control to show a to show something like a log in other table but i don't how to get td's id and filter the table by it. When I click on td.details-control shows all the table's values.
js
$('#cliente').on( 'click', 'td.details-control', function () {
document.getElementById('historico').style.display='block';
} );
var table = $('#venda').DataTable( {
dom: 'Bfrtip',
ajax: 'controller/controller_historico.php',
columns: [
{
"data": "cliente.nome"
},
{
"data": "vendedor.nome"
},
{
"data": "venda.dta_venda"
},
{
"data": "venda.valor_total_pago"
},
{
"data": "venda.valor_total_liquido"
}
],
select: true,
buttons: [
]
}
} );
html
Histórico de compras do cliente
Cliente | Vendedor | Data da Compra | Valor Total Pago | Valor Líquido |
---|
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
It compiled my html but it's a modal that shows the datatable #venda
Can you link to a test case showing the issue please?
Allan
Hi Allan, this is my test. I tried to do something that you could understand because i am using a local bank.
I would like that the new datatable shows the datas from an other bank table but from the same person a clicked.
http://live.datatables.net/yorojuye/1/
You are using a DOM0 event handler:
I would suggest you remove that and replace it with a jQuery delegate event handler:
Allan
I've made some changes and I would like to use the firt colum of the rowdata (tr) in this field, like that:
Thats what I needed