Open rrameshkumar76 opened 5 years ago
May could do something like
renderTableBody: function (columns, rows) {
var self = this
var parents = new Map()
return (
<tbody>
{rows.map(function (row) {
parents.set(row._level, row)
return (
<tr key={row._key} className={"reactPivot-level-" + row._level}>
{columns.map(function (col, i) {
if (i < row._level) return <td key={i} className='reactPivot-indent' />
var topLevelParent = parents.get(0)
var previousLevelParent = row._level > 0 ? parents.get(row._level - 1) : topLevelParent
return self.renderCell(col, row, topLevelParent, previousLevelParent)
})}
</tr>
)
})}
</tbody>
)
},
to calculate all the parents and pass to the renderCell and from there to template methods
Is there a way to calculate percentages for totals columns for each row corresponding to group total
Basically if there is a way to to get the group total or the row in calculations for the level above.
If not I guess we need to pass back the parent record to the template