I need to render the data before incrementing a counter, but the counter is being incremented, so it only displays the last value, see:
this.totalMeses = 0;
if (verificaSeTemTotal && tipoCenario === ‘LONGO_PRAZO’) {
const btTotal = ‘’;
const headerContentTotal = <div class="d-flex"><span>${data[1]}</span>${btTotal}</div>
;
columns.push({
def: data[1],
header: headerContentTotal,
type: ‘numeric’,
templateRef: templateRefValueCol,
content: (row) => this.teste(row, this.totalMeses),
width: this.size ? this.size : 60,
readOnly: true,
initHidden: true,
styled: false,
tipoColumn: ‘total’,
clickHeader: tipoCenario === ‘LONGO_PRAZO’ ? fnOpenColumns : null,
});
}
if (data[1] !== dataPosterior[1] && tipoCenario === ‘LONGO_PRAZO’) {
this.totalMeses++;
columns.push({
def: ‘separador’,
header: ‘’,
tipoColumn: ‘separador-2’,
templateRefHeader: templateRefSeparadorHeader,
content: () => this.separadorContent(),
templateRef: templateRefSeparador,
readOnly: true,
width: 10,
styled: false,
});
}
});
return columns;