Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

285
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda