Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

283
Vistas
how to sum each specific rendered row horizontally on jquery datatable

I get data for datasrc from sql query and I display for each column using

"data": "attribute", "name": "name",
                    "render": function (data, type, full, meta) {}

I can't get calculate value from sql query, I have to get each rendred value of specific row to sum and put the result in each column horizontally exemple bellow of eachrow : row 1 col1 + row 1 col2 + row 1 col3 and put te result in row 1 col4

and the same for all horizontal ligne.

Rows                  Col1        Col2      Col3    Col4  col5      col6      col7 
1                      12         1         23       36    string    string   string
2                       1         0          5       6     string    
3                       6         2          9       16    string    

for this jquery datatable serverside Showing 1-10:

"autoWidth": true,
            "processing": true,
            "serverSide": true,
            "ajax": {
                'type': 'POST',
                'url': 
                'dataSrc':function (json) {
                   

                    return json.data;
                },
                'complete': function (response) {
                   
                }
            },
            "columns": [
                {"data": "id"},
               {"data": "attribute", "name": "name",
                    "render": function (data, type, full, meta) {}
}
                    ---
                  ---
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Consider the following snippet.

"columns": [{
  "data": "id"
},
{
  "data": "attribute",
  "name": "name",
  "render": function(data, type, row, meta) {
    return (row[1] + row[2] + row[3]);
  },
  "targets": 4
}]

See More: https://datatables.net/reference/option/columns.render

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda