Use Kartik Grid View. Check these posts on how to implement Kartik Grid View for exporting and how to use Kartik Grid View with filters
Add the attribute in which you want to have a summary displayed when defining $gridcolumn
[ 'attribute'=>'total', 'format' => ['decimal', 2], 'pageSummary' => true ],
When calling Grid View widget, make sure to set showPageSummary to true
<?= GridView::widget([ 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'containerOptions' => ['style' => 'overflow: auto'], // only set when $responsive = false 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'pjax' => true, 'floatHeader'=>true, 'floatHeaderOptions'=>['scrollingTop'=>'50'], 'showPageSummary' => true, ....... ]); ?>
Here’s a screenshot…
0 Comments