0
Good morning,
I am needing to "SCAN" my Datatable and get only the selected line, could someone please help me?
The action will occur after the click of any button.
I have this code below where I can scan the Datatable and get the obj value of the column I need to play in an array, but I only need the values where I have marked the lines and not all, so it’s taking all the lines:
$('#btnAceitar').on('click', function(event) {
if (confirm('Tem certeza que deseja dar aceite de saída de NF?')) {
$('#tabela_listaFuncVeic').DataTable().columns(3).every(function() {
data = this.data();
//FAZ O LOOP PARA ADD NA VARIAVEL DO TIPO ARRAY
$.each(data, function(idx, obj) {
console.log(idx);
vObj += (obj + '||');
});
});
} else {
return false;
};
});
The screen is according to the image below:
Thanks in advance.
Sam worked well only to take the selected line, but with the exchange of this line $.each(data, Function(idx, obj) { for $.each(lines, Function(idx, obj) { how do I now take the value of Columns(3) and assemble my array?
– Leandro Ferreira
I forgot that detail. I changed the answer.
– Sam
Perfect Sam, it worked, thank you very much.
– Leandro Ferreira