hi, i want to add total under my datatables report, but im getting error undefined index total. here is my code:
->pipe(new \koolreport\processes\Map(array(
"{value}"=>function($row, $meta, $index, $mapState)
{
$total = isset($mapState['Total'])?$mapState['Total']:[];
if(!isset($total['Total']))
{
$total['Total'] = 0;
}
$total['Total'] += 1*$row['Total']; // -> here is the error line
$mapState['Total'] = $total;
return ['{rows}' => $row, '{state}' => $mapState];
},
"{end}" => function($count, $mapState)
{
$total = $mapState['Total'];
return [$total];
}
)))