0
On a website, I have the following function in Javascript
to bring me in a table the result of a query SQL
.
function buscaBoletos(){
$.ajax({
async: false, cache: false,
url: '[:raiz]emissaoBoletos/getBoletos',
data: ({
unidade: $('#comboUnidades').val(),
de: $('#txtData1').val(),
ate: $('#txtData2').val()
}),
dataType: 'json',
success: function(data) {
$('#divBoletosLista').hide();
var retorno = "";
if (data.length > 0){
for(var i = 0;i< data.length;i++){
retorno += "<tr>";
retorno += "<td style='text-align:left; width:300px'>"+data[i]['razaosocial']+"</td>";
retorno += "<td style='width: 100px'>"+data[i]['nossonumero']+"</td>";
retorno += "<td style='width: 80px'>"+data[i]['status']+"</td>";
retorno += "<td style='width: 80px'>"+data[i]['valor']+"</td>";
retorno += "<td style='width: 100px'>"+data[i]['dataemissao']+"</td>";
retorno += "<td style='width: 100px'>"+data[i]['datavencimento']+"</td>";
retorno += "<td><input class='botaoCad' type='button' value='Visualizar' style='float:none' onclick='verBoleto()'></td>";
retorno += "</tr>";
}
} else {
retorno = "<tr><td colspan='7' align='center'>"+$('#lblSemRegistros').val()+"</td></tr>";
}
$('#bodyBoletosLista').html(retorno);
$('#divBoletosLista').show();
$('#divTelaBoleto').hide();
}
});}
As next, step I would like to be able to click the button that is generated in the last column of the row (of the function verBoleto()
) and thus fill in a billet (in table format) with the respective row data.
How do I do that?
Did you get an answer to your question?
– durtto