I want to make that when increasing the input type number this data is updated in column 9 where a s

I want to make that when increasing the input type number this data is updated in column 9 where a s

albert04albert04 Posts: 2Questions: 2Answers: 0

$('#dataTableRequestRM').DataTable({
"searching": false,
"fnRowCallback": function( nRow, data, iDisplayIndex, iDisplayIndexFull ) {
if ( data["default"] == true )
{
$('td', nRow).css('background-color', '#ffdf00')
$('td', nRow).css('color', '#000000')
}
},
processing: true,
lengthMenu: [100, 50, 75],
order: [
[0, "asc"]
],
deferRender: true,
data: data,
columns: [{
data: null,
render: function(data, type, row) {
return data["provedorMateriaPrimaSDMPtr"]["materiaPrimaPtr"]["nombre"]
}
},
{
data: null,
render: function(data, type, row) {
return data["provedorMateriaPrimaSDMPtr"]["proveedorPtr"]["nombre"]
}
},
{
data: null,
render: function(data, type, row) {
return formatter.format(data["provedorMateriaPrimaSDMPtr"]["costo"])
}
},
{
data: null,
render: function(data, type, row) {
return data["provedorMateriaPrimaSDMPtr"]["cantidadMinima"]
}
},
{
data: null,
render: function(data, type, row) {
return formatter.format( parseInt(data["provedorMateriaPrimaSDMPtr"]["cantidadMinima"]) * parseInt(data["provedorMateriaPrimaSDMPtr"]["costo"]) )
}
},
{
data: null,
render: function(data, type, row) {
return data["transporteSDMPtr"]["tipoEnvio"]
}
},
{
data: null,
render: function(data, type, row) {
return data["transporteSDMPtr"]["diasEntrega"]+" Day(s)"
}
},
{
data: null,
render: function(data, type, row) {
return formatter.format(data["transporteSDMPtr"]["precio"])
}
},
{
data: null,
render: function(data, type, row) {
return data["transporteSDMPtr"]["porcentajePrecio"]+"%"
}
},
{
data: null,
render: function(data, type, row) {
return "<span>2</span>"
}
},
{
data: null,
render: function(data, type, row) {
return '<span>1</span>'
}
},
{
data: null,
render: function(data, type, row) {
return '<input type="number" class="catidadComprar form-control" aria-describedby="inputGroupPrepend" id="input_purchasing_cart'+data["objectId"]+'" min="'+data["provedorMateriaPrimaSDMPtr"]["cantidadMinima"]+'" value="'+data["provedorMateriaPrimaSDMPtr"]["cantidadMinima"]+'" required>'
}
},
{
data: null,
render: function(data, type, row) {
let json = JSON.stringify(data).replace(/\"/g,""")
return '<button type="button" class="btn btn-primary font-weight-bold" data-toggle="tooltip" onclick="addToCart('+json+')" data-placement="bottom" title="Add to cart"> <i class="fas fa-cart-plus"></i></button>'
}
}
]
})

}

$( "#dataTableRequestRM" ).on( "change", "input", function () {
table = $('#dataTableRequestRM').DataTable();
var td = $(this).closest('tr').find('td:eq(9)');
table.cell( td ).data($(this).closest('tr').data()).draw();
});

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Duplicate of this thread, please only post once,

    Colin

Sign In or Register to comment.