0
Hello, in my code how do I call the function (#print) the values contained in the "data" array are obtained from the generating functionString.
var gerarString = function () {
var codproduto = 001,
var newRow = 'teste',
var iten = ([codproduto,newRow]);
var dados = new Array();
dados.push(iten);
return dados;
}
$("#imprimir").on('click', function(){
console.log(gerarString.dados);
//$("#tabvenda").prepend(gerarString.getDados());
});
I don’t understand your problem or how you intend to use this array within an array.
console.log(gerarString());
seems like the solution, but I think the real problem you have is another and it would be interesting to see it so that I can understand and help better.– Sergio
@Sergio looking at all the code will be easier to understand. What I intend to do is that when selecting some checkbox, the data (value) will be stored in an array and sent to table 1 by clicking submit. The intention of using an array within another array is that it would use product code to validate if the same checkbox is clicked more than once, preventing it from being duplicated. https://jsfiddle.net/LGian/4Lpu7vao/3/
– GiaN
I believe that there must be a more "clean" way to do this process, but I still do not know.
– GiaN