Personal Talk!
I need your help! I am using the jquery datatable plugin to generate a dynamically paged table in a modal, so alright, but inside this table I have an input that I need to get the value typed after the user confirm on a button in the click event, then this is the problem I got get the value with the following code:
$('#TabelaPecas2 > tbody > tr').find("input[id^='txtQuantidade']").each(function(){
if($(this).val() != "")
{
alert($(this).val());
}
});
but returns only the inputs from the first page. in the code below I am getting the data of all the pages but I can not get the value typed by the user.
var table = $('#TabelaPecas2').DataTable();
table.rows().every( function () {
var data = table.row( this ).data();
//pega valores input da terceira coluna
console.log($(data[2]).val());
});
UPDATE
Personal, whom I was interested to do as follows:
var table = $('#TabelaPecas2').DataTable();
table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
var dados = table.row( this ).data();
var cell = table.cell({ row: rowIdx, column: 2 }).node();
if ($('input', cell).val() != ""){
var objPecas = new Peca(dados[0], dados[1], $('input', cell).val());
objServico.pecas.push(objPecas);
}