Forum Stats

  • 3,872,061 Users
  • 2,266,374 Discussions
  • 7,911,042 Comments

Discussions

IG JavaScipt

Dernbauer
Dernbauer Member Posts: 105 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