I'm using MVC4 C #,
I have a table that is dynamically generated according to the user's decision, in this format:
generated by js
<tr class="itemPedido"> ' +
'<td class="col-sm-1">' +
'<p class="codigo">' + $(this).attr('data-codigo') + '</p>' +
'</td>' +
'<td class="col-sm-4">' +
'<p class="desc">' + $(this).attr('data-desc') + '</p>' +
'</td>' +
'<td class="col-sm-1">' +
'<p class="un">' + $(this).attr('data-un') + '</p>' +
'</td>' +
'<td class="col-sm-1">' +
'<p class=grupo">' + $(this).attr('data-grupo') + '</p>' +
'</td>' +
'<td class="col-sm-1">' +
'<input class="form-control qnt" step ="0.01" type="number" placeholder="' + parseFloat($(this).attr('data-qnt').replace(',','.')) + '" data-max="' + $(this).attr('data-qnt') + '"' +
'</td>' +
'<td class="col-sm-1">' +
'<input class="form-control preco"step="0.01" type="number" value="'+parseFloat($(this).attr('data-preco').replace(',','.'))+'"' +
'</td>' +
'<td class="col-sm-1 total">' +"R$ 0.00"+
'</td>' +
'</tr>'
What I want is to generate an object to go up by ajax
of all listed objects plus some objects that are not in the table as a form of payment;
Follows the js
I've mounted so far
var data = {
date : $('#Data').val(),
clienteNo: $('#ClienteNO').val(),
clienteRaz: $('#ClienteRazao').val(),
entrega: $('#Entrega').val(),
formapg: $("#FormaPg").val(),
tipopg: $('#tipopg').val(),
frete: $('#frete').val(),
processo: $('#Processo').val(),
obs: $('#Obs').val(),
traNum: $('#TraNumero').val(),
traRaz: $('#TraRazao').val(),
traTel: $('#TraTel').val(),
produtos: /*?????*/
}
The question marks are referring to the product I want to assemble through the table, does anyone have any solutions to my problem? and how do I get this value in Controller
?