1
I have to show or hide a button inside my Datatable as an ajax function returns.
I can already hide (hide all by default) and already know when to show the button, the problem is that I can not show the specific button of that TR.
This is my job:
$JQuery(document).ready(function() {
$JQuery(".regra").hide();
$.post("/main/conciliacao/botao", {id:<?php echo $id ?>, processo:<?php echo $processo ?>}, function(d) {
if (d !== "false") {
var aux = d.split(":");
for (i = 0; i < aux.length; i++) {
var n = aux[i].replace(/[^\d]+/g, '');
$("tbody>tr").each(function(index, tr) {
var id = tr.cells[0].innerHTML;
if (n == id) {
var botoes = tr.cells[4].innerHTML;
alert(botoes);
}
});
}
}
});
});
I can already access what’s on the button Cell:
<a class="grid" href="javascript:void(0)" title="Arrumar erros"><i class="glyphicon glyphicon-th-list"></i></a> <a style="display: none;" class="regra" href="javascript:void(0)" title="Aplicar regra"><i class="glyphicon glyphicon-book"></i></a>
My problem is I can’t find anything to use .show()
that shows only the button of that TR.
http://jsfiddle.net/filadown/e1vqqvfg/1/
– Gabriel Rodrigues