title: Yii2: How to have sum in footer based on previous pages' sum?
body: <p>Please look the picture below.</p>
  
  <p><a href="https://i.stack.imgur.com/Gq2HU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gq2HU.png" alt="enter image description here"></a></p>
  
  <p>As you can see total is <strong>215340</strong> in the summary column. What I want is that in the next page it should start summing those numbers on this number.</p>
  
  <p>Here is a code.</p>
  
  <pre><code> GridView::widget([
      'dataProvider' =&gt; $dataProvider,
      //  'filterModel' =&gt; $searchModel,
      'columns' =&gt; [
        [
          'class' =&gt; 'kartik\grid\SerialColumn'],
        //     'id',
        [
          'attribute' =&gt; 'customer_id',
          'value' =&gt; function ($data) {
            return $data-&gt;customerDetail-&gt;account_no;
          }
        ],
        [
          'attribute' =&gt; 'naration',
          'pageSummary' =&gt; 'Total',
        ],
        [
        'attribute' =&gt; 'transaction_type',
        'label' =&gt; 'Deposits',
        'pageSummary' =&gt; true,
        'pageSummaryOptions' =&gt; ['id' =&gt; 'total_sum'],
        'value' =&gt; function ($data) {
          if($data-&gt;transaction_type==10)
            return $data-&gt;amount;
          else
            return 0;
          }
        ],
        [
        'attribute' =&gt; 'transaction_type',
        'label' =&gt; 'Withdrawals',
        'pageSummary' =&gt; true,
        'value' =&gt; function ($data) {
          if($data-&gt;transaction_type==11)
            return $data-&gt;amount;
          else
            return 0;
          }
        ],
        [
          'class' =&gt; 'backend\components\TotalColumn',
          'label' =&gt; 'Balance',
          'attribute' =&gt;'amount',
        ],
  
      ],
      // This line displays sum of the columns.
      'showPageSummary' =&gt; true,
    ]);
  ?&gt;
  </code></pre>
  
  <p>I was thinking about sending this page's sum to the next page using <code>$_GET</code> but the problem is when user going to previous pages i.e. from page 3 to 2. Do you any widget or something for this problem?</p>