I have to show or hide a button inside my DataTable as the return of an ajax function.
I can already hide (I hide all by default) and I already know when I have to show the button, the problem is that I can not show the specific button of that TR.
This is my role:
$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 in 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 that I do not think anything to use .show()
that just shows the button of that TR.