value='1' data-chkIdProcessamentoDiario='1' data-chkIdRegistro='1'
and assign in an array, but the problem is that each
does not go through table html , although the browser log shows the opposite:
Boon:
<inputclass="btn btn-primary downloadPDF" value="Download PDF" type="button" id="BbtnDownloadPDF" />
Button event:
$(document).on('click', '.downloadPDF', function (e) {
e.preventDefault();
var dados = [];
var i = 0;
var table = $('.grid > tbody');
table.find('tr').each(function () {
var _idprocessamentodiario = $('.chkProcessamentoDiario').data('chkidprocessamentodiario');
var _idregistro = $('.chkProcessamentoDiario').data('chkidregistro');
var _idservico = $('.download').data('idservico');
dados[i] = new Object();
dados[i]['IdProcessamentoDiario'] = _idprocessamentodiario;
dados[i]['IdRegistro'] = _idregistro;
dados[i]['IdServico'] = _idservico;
console.log(i + ' - _idprocessamentodiario: ' + dados[i].IdProcessamentoDiario + '| _idregistro: ' + dados[i].IdRegistro + '| idservico: ' + dados[i].IdServico);
i++;
});
});
This is the HTML table:
<table class="grid">
<thead>
<tr class="header">
<th scope="col">
</th>
<th scope="col">
<a href="/Documento?sort=EMPRESA&sortdir=ASC">EMPRESA</a> </th>
<th scope="col">
<a href="/Documento?sort=CNPJ&sortdir=ASC">CNPJ</a> </th>
<th scope="col">
<a href="/Documento?sort=CERT+CONJ+RFB%0d%0a&sortdir=ASC">CERT CONJ RFB
</a> </th>
<th scope="col">
<a href="/Documento?sort=CERTIF+FGTS%0d%0a&sortdir=ASC">CERTIF FGTS
</a> </th>
<th scope="col">
<a href="/Documento?sort=CND+D%c3%8dVIDA+ATIVA+DA+UNI%c3%83O&sortdir=ASC">CND DÍVIDA ATIVA DA UNIÃO</a> </th>
<th scope="col">
<a href="/Documento?sort=CND+FGTS&sortdir=ASC">CND FGTS</a> </th>
<th scope="col">
<a href="/Documento?sort=RECEITA+FEDERAL+PESSOA+JUR%c3%8dDICA+-+CNPJ&sortdir=ASC">RECEITA FEDERAL PESSOA JURÍDICA - CNPJ</a> </th>
<th scope="col">
<a href="/Documento?sort=TRIBUTOS+MOBILI%c3%81RIOS%0d%0a&sortdir=ASC">TRIBUTOS MOBILIÁRIOS
</a> </th>
</tr>
</thead>
<tbody>
<tr>
<td><input class='.checkbox-primary .checkbox-info chkProcessamentoDiario' id='chkProcessamentoDiario' name='chkProcessamentoDiario' type='checkbox' value='1' data-chkIdProcessamentoDiario='1' data-chkIdRegistro='1'/></td>
<td><div style='width:100%; height:100%; float:left;white-space:nowrap;'>ENERGIAS RENOVAVEIS S.A.</div></td>
<td><div style='width:100%; height:100%; float:left;white-space:nowrap;'>08.439.659/0001-50</div></td>
<td></td>
<td></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem1' data-IdProcessamentoDiario=1 data-IdRegistro=1 data-IdServico=1><span style='cursor:pointer'>CERTIDÃO POSITIVA</span></a></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem2' data-IdProcessamentoDiario=1 data-IdRegistro=1 data-IdServico=2><span style='cursor:pointer'>Regular</span></a></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem3' data-IdProcessamentoDiario=1 data-IdRegistro=1 data-IdServico=3><span style='cursor:pointer'>ATIVA</span></a></td>
<td></td>
</tr>
<tr class="alt">
<td><input class='.checkbox-primary .checkbox-info chkProcessamentoDiario' id='chkProcessamentoDiario' name='chkProcessamentoDiario' type='checkbox' value='1' data-chkIdProcessamentoDiario='1' data-chkIdRegistro='2'/></td>
<td><div style='width:100%; height:100%; float:left;white-space:nowrap;'>ENERGIAS RENOVAVEIS S.A. 2</div></td>
<td><div style='width:100%; height:100%; float:left;white-space:nowrap;'>08.439.659/0002-31</div></td>
<td></td>
<td></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem1' data-IdProcessamentoDiario=1 data-IdRegistro=2 data-IdServico=1><span style='cursor:pointer'><font color='red'><b>A certidão deve ser emitida para o CNPJ da matriz ? 08.439.659/000150</b></font></span></a></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem2' data-IdProcessamentoDiario=1 data-IdRegistro=2 data-IdServico=2><span style='cursor:pointer'>Regular</span></a></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem3' data-IdProcessamentoDiario=1 data-IdRegistro=2 data-IdServico=3><span style='cursor:pointer'><font color='red'><b>BAIXADA</b></font></span></a></td>
<td></td>
</tr>
<tr>
<td><input class='.checkbox-primary .checkbox-info chkProcessamentoDiario' id='chkProcessamentoDiario' name='chkProcessamentoDiario' type='checkbox' value='1' data-chkIdProcessamentoDiario='1' data-chkIdRegistro='3'/></td>
<td><div style='width:100%; height:100%; float:left;white-space:nowrap;'>EOL HOLDING S.A.</div></td>
<td><div style='width:100%; height:100%; float:left;white-space:nowrap;'>11.594.952/0001-05</div></td>
<td></td>
<td></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem1' data-IdProcessamentoDiario=1 data-IdRegistro=3 data-IdServico=1><span style='cursor:pointer'>CERTIDÃO NEGATIVA</span></a></td>
<td></td>
<td><a href='#' class='download' name='downloaditem' id='downloaditem3' data-IdProcessamentoDiario=1 data-IdRegistro=3 data-IdServico=3><span style='cursor:pointer'>ATIVA</span></a></td>
<td></td>
</tr>
</tbody>
</table>