title: Cumulative/Running Total in Yii2 gridview
body: <p>I am trying to achieve running total in yii2 grid view. I have tried below but I can't quite get the expected result. The data is from an active dataprovider. </p>
  
  <pre><code>$runningtotal = 0;
  
  echo GridView::widget([
  'dataProvider' =&gt; $dataProvider,
  'filterModel' =&gt; $searchModel,
  'pjax' =&gt; true,
  'columns' =&gt; [
  
      [
          'class' =&gt; '\kartik\grid\DataColumn',
          'attribute' =&gt; 'pax',
          'format' =&gt; 'decimal',
          'pageSummary' =&gt; true
      ],
      [
          'value' =&gt; function ($model, $key, $index, $widget) use($runningtotal){
              $runningtotal+= ($model-&gt;pax);
              return $runningtotal;
          },
          'class' =&gt; '\kartik\grid\DataColumn',
          'label' =&gt; 'Running Total',
          'attribute' =&gt; 'paxtotal', //'format' =&gt; 'decimal',
      ],
  ],
  ]);
  </code></pre>
  
  <p>My challenge is having the running total on this gridview. </p>