php – Yii2:页脚中的Kartik Gridview总和

前端之家收集整理的这篇文章主要介绍了php – Yii2:页脚中的Kartik Gridview总和前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我安装了Kartik gridview扩展,工作正常.

但是我无法在文档中找到或遗漏它,我如何在页脚中显示列的总和.

这是我在index.PHP中的完整代码

<?PHP 
        $gridColumns = [
    ['class' => 'yii\grid\SerialColumn'],'id',[
        //'attribute'=>'service_name','attribute'=>'service_name','value'=>'serviceName.services',],[
        'attribute'=>'room_category','value'=>'roomCategory.room_category'
     ],'charges_cash','charges_cashless',['class' => 'yii\grid\ActionColumn']
];

    echo ExportMenu::widget([
    'dataProvider' => $dataProvider,'columns' => $gridColumns,'fontAwesome' => true,'showPageSummary' => true,'dropdownOptions' => [
        'label' => 'Export All','class' => 'btn btn-default'
    ]
]) 
        ?>
    </div></div>


    <?= GridView::widget([
        'dataProvider' => $dataProvider,'filterModel' => $searchModel,'columns' => [
            ['class' => 'yii\grid\SerialColumn'],//'service_name',[
                //'attribute'=>'service_name',// 'room_category',[
                'attribute'=>'room_category','value'=>'roomCategory.room_category'
            ],['class' => 'yii\grid\ActionColumn'],'showFooter' => true
    ]); ?>

</div>

寻求这方面的一些帮助.
谢谢.

我想你只需要添加页面摘要;
use kartik\grid\GridView;

// Create a panel layout for your GridView widget
echo GridView::widget([
    'dataProvider'=> $dataProvider,'showPageSummary' => true
]);

Kartik在demo插件细节中很好地描述了它.

原文链接:https://www.f2er.com/php/139123.html

猜你在找的PHP相关文章