'how to update a cell, row by row datatable

I have the following problem, I have these inputs, the two main CODE AND DESCRIPTION, it paints them automatically, the other 3 I have to fill them. When adding an existing record, what it does is add the QUANTITY value with the one already registered. But the problem is that in the 2nd record the sum is made for all the fields of all the rows, I would like it to do the sum individually row by row.

enter image description here

"columns": [ //code where the input is located inside the table
            { "data": "ProductoFila" },
            { "data": "ProductoCodigo" },
            { "data": "ProductoNombre" },
            { "data": "ProductoCostoActual"
                , render: function (data) {
                    return ' <input type="text" id="tableCostoActual" style="font-size: 12px;" class="form-control text-center floatNumberField" value="' + parseFloat(data).toFixed(6) + '">';
            }
            },
            { "data": "ProductoCantidad"
                , render: function (data, type, row) {
                    return '<input type="text" id="tableCantidad" style="font-size: 12px;"  class=" form-control full-width text-lg-center" value="' + parseFloat(data).toFixed(0) + '" >';
                }
            },
            { "data": "Descuento"
                , render: function (data, type, row) {
                    return ' <input type="text" id="tableDescuento" style="font-size: 12px;" class="form-control text-center floatNumberField" value="' + parseFloat(data).toFixed(6) + '">';
                }
            },
            { "data": "ProductoTotal" },
            {
                //pestaña no agregada en DB
                "defaultContent": '<button type="button" class="btn btn-danger btn-sm ms-2 btn-eliminar"> <i class="fas fa-trash"></i> </button>', //ms-2: modificar las distancia de separacion del icono
                "orderable": false,
                "searchable": false, // ESTO SIGNFICA QUE AL MOMENTO DE BUSCAR UN CONTACTO, NO MUESTRE ESTE COLUMNA CON LOS DOS BOTONES
                "width": "20px" //modificar ancho de la columna
            }
        ],




        //Find if a product exists  
        var productoNuevo = 0;
        var row = tabladata.row(4).node();
        var text = parseInt($("#txtCantidad").val()) + parseInt($("#tableCantidad").val());
      
  
        tabladata
            .column(1)
            .data()
            .each(function (value, index) {
                if (value == $("#txtCodigo").val()) {
                    productoNuevo = 1;
                    /*tabladata.cell(row, 4).data(text).draw();*/
                    tabladata.column(4).nodes().each(function (node, index, dt) {
                        tabladata.cell(node).data(text);
                    });
                  
                    toastr["warning"]("Producto ya existe")
                }
            });


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source