0
I have a table, which I need to fill out dynamically, as the user adds the information. How can I get this information, I already have the function that picks it up, and add it to Datatable ? Follow the function I get the fields filled:
function Adicionar() {
var url = "/PedidoFornecedor/Adicionar";
var ProdutoID = $("#produtoid").val();
var CodigoProduto = $("#idproduto").val();
var Qtd = $("#qtd").val();
var PrecoCusto = $("#precocusto").val();
var DescontoV = $("#descontov").val();
var DescontoP = $("#descontop").val();
var ICMS = $("#icms").val();
var AliquotaICMS = $("#aliquotaicms").html().replace("%", "");
var IPI = $("#ipi").val();
var ISS = $("#iss").val();
var PedidoID = $("#pedidoid").val();
var DataEntrega = $("#dataentrega").val();
$.ajax({
url: url,
data: {
produtoid: ProdutoID, codigoProduto: CodigoProduto, qtd: Qtd, precoCusto: PrecoCusto,
descontoV: DescontoV, descontoP: DescontoP, icms: ICMS, aliquotaICMS: AliquotaICMS,
ipi: IPI, iss: ISS, dataEntrega: DataEntrega, pedidoID: PedidoID
},
datatype: "json",
type: "POST",
success: function (data) {
if (data.resultado) {
}
}
})
}
How can I include in Datatable ?
calling a function that fetches the data again would not solve the problem ?
– Lucas Brogni
Loading the datatable you speak of?
– Mariana
This, would call him again, theoretically the table would receive the data that has just been registered.
– Lucas Brogni
But it is not being registered in the database, not yet, I need to send the data, and only later when the user click on another save button.
– Mariana
Oh yes, you can post the datatable structure?
– Lucas Brogni
@Lucasbrogni there that I do not know, because I use . NET CORE, if you have some example to help me.
– Mariana
Let’s go continue this discussion in chat.
– Lucas Brogni