Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

282
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!