Forum Stats

  • 3,827,149 Users
  • 2,260,746 Discussions
  • 7,897,182 Comments

Discussions

IG JavaScipt

Dernbauer
Dernbauer Member Posts: 103 Red Ribbon

Hello,

How can I add the values within a Grid

I did the following

var model = apex.region("IG1").widget().interactiveGrid("getViews","grid").model;

var var1 = model.getFieldKey("VAR1");

var sum;

model.forEach(function(igrow) {

    sum = Number(sum) + Number(igrow[var1]);

    console.log("VAR1" + var1);

    console.log(Number(igrow[var1]));

    console.log(sum);

})

console.log("Wert");

console.log(sum);


But it is always like this and not a sum


Thanks

Answers