我安装了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和插件细节中很好地描述了它.