add format number in datatables

This commit is contained in:
amazuecos
2025-02-09 00:25:52 +01:00
parent 21a4e5b8bd
commit f532c79b27
17 changed files with 361 additions and 132 deletions

View File

@ -72,10 +72,10 @@ $('#tableOfPedidos thead tr:eq(1) th').each(function (i) {
var title = $(this).text();
if($(this).hasClass("totalizador")){
if(i==9){
$(this).html('<label id="total_tirada" />');
$(this).html('<span id="total_tirada" class="autonumeric"></span>');
}
else if(i==10){
$(this).html('<label id="total_aceptado" />');
$(this).html('<span id="total_aceptado" class="autonumeric"></span>');
}
}
else{
@ -220,9 +220,9 @@ $('#tableOfPedidos thead tr:eq(1) th').each(function (i) {
{ 'data': 'titulo' },
{ 'data': 'ubicacion' },
{ 'data': 'inc_rei' },
{ 'data': 'paginas' },
{ 'data': 'tirada' },
{ 'data': 'total_presupuesto' },
{ 'data': 'paginas',render : (d) => `<span class="autonumeric">${d}</span>` },
{ 'data': 'tirada',render : (d) => `<span class="autonumeric">${d}</span>` },
{ 'data': 'total_presupuesto',render : (d) => `<span class="autonumeric">${d}</span>`},
{ 'data': 'estado',
render: function(data, type, row, meta) {
switch(data){
@ -278,12 +278,6 @@ $('#tableOfPedidos thead tr:eq(1) th').each(function (i) {
});
}
for (let coln of priceCols) {
theTable.column(coln, { page: 'current' }).nodes().each( function (cell, i) {
cell.innerHTML = parseFloat(cell.innerHTML).toFixed(2);
});
}
if(<?= $cliente_id ?> != -1){
// Se oculta la columna de cliente (3)