<tfoot id='V4US1'></tfoot>
    <i id='V4US1'><tr id='V4US1'><dt id='V4US1'><q id='V4US1'><span id='V4US1'><b id='V4US1'><form id='V4US1'><ins id='V4US1'></ins><ul id='V4US1'></ul><sub id='V4US1'></sub></form><legend id='V4US1'></legend><bdo id='V4US1'><pre id='V4US1'><center id='V4US1'></center></pre></bdo></b><th id='V4US1'></th></span></q></dt></tr></i><div id='V4US1'><tfoot id='V4US1'></tfoot><dl id='V4US1'><fieldset id='V4US1'></fieldset></dl></div>

        <bdo id='V4US1'></bdo><ul id='V4US1'></ul>

      <small id='V4US1'></small><noframes id='V4US1'>

      <legend id='V4US1'><style id='V4US1'><dir id='V4US1'><q id='V4US1'></q></dir></style></legend>

      Yii2:Kartik Gridview 页脚中一列的总和

      时间:2023-05-21

        <i id='6wfut'><tr id='6wfut'><dt id='6wfut'><q id='6wfut'><span id='6wfut'><b id='6wfut'><form id='6wfut'><ins id='6wfut'></ins><ul id='6wfut'></ul><sub id='6wfut'></sub></form><legend id='6wfut'></legend><bdo id='6wfut'><pre id='6wfut'><center id='6wfut'></center></pre></bdo></b><th id='6wfut'></th></span></q></dt></tr></i><div id='6wfut'><tfoot id='6wfut'></tfoot><dl id='6wfut'><fieldset id='6wfut'></fieldset></dl></div>
          <tbody id='6wfut'></tbody>

          1. <legend id='6wfut'><style id='6wfut'><dir id='6wfut'><q id='6wfut'></q></dir></style></legend>
              <bdo id='6wfut'></bdo><ul id='6wfut'></ul>

                <small id='6wfut'></small><noframes id='6wfut'>

                <tfoot id='6wfut'></tfoot>
              • 本文介绍了Yii2:Kartik Gridview 页脚中一列的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我已经安装了 Kartik gridview 扩展,它运行良好.

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

                这是我在index.php

                中的完整代码

                'yiigridSerialColumn'],'ID',[//'attribute'='service_name','属性'='服务名称','value'=>'serviceName.services',],['attribute'='room_category','value'='roomCategory.room_category'],'charges_cash','charges_cashless',['类' =>'yiigridActionColumn']];echo ExportMenu::widget(['数据提供者' =>$数据提供者,'列' =>$gridColumns,'fontAwesome' =>真的,'showPageSummary' =>真的,'下拉选项' =>['标签' =>'全部导出','类' =>'btn btn-默认']])?></div></div><?= GridView::widget(['数据提供者' =>$数据提供者,'过滤器模型' =>$搜索模型,'列' =>[['类' =>'yiigridSerialColumn'],'ID',//'服务名称',[//'attribute'='service_name','属性'='服务名称','value'=>'serviceName.services',],//'房间类别',['attribute'='room_category','value'='roomCategory.room_category'],'charges_cash','charges_cashless',['类' =>'yiigridActionColumn'],],'showFooter' =>真的]);?>

                正在寻找有关此问题的帮助.谢谢.

                解决方案

                我觉得你只需要添加页面摘要;

                使用kartikgridGridView;//为您的 GridView 小部件创建面板布局回声 GridView::widget(['数据提供者'=>$数据提供者,'过滤器模型' =>$搜索模型,'列' =>$gridColumns,'showPageSummary' =>真的]);

                Kartik 在演示和插件详细信息中对其进行了很好的描述.

                I have installed the Kartik gridview extension, which is working fine.

                But I couldn't find or missed it in the docs, how I can show the sum of a column in the footer.

                This is my complete code in index.php

                <?php 
                        $gridColumns = [
                    ['class' => 'yiigridSerialColumn'],
                    'id',
                    [
                        //'attribute'=>'service_name',
                        'attribute'=>'service_name',
                        'value'=>'serviceName.services',                
                    ],
                    [
                        'attribute'=>'room_category',
                        'value'=>'roomCategory.room_category'
                     ],
                        'charges_cash',
                        'charges_cashless',
                    ['class' => 'yiigridActionColumn']
                ];
                
                    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' => 'yiigridSerialColumn'],
                
                            'id',
                            //'service_name',
                            [
                                //'attribute'=>'service_name',
                                'attribute'=>'service_name',
                                'value'=>'serviceName.services',
                
                            ],
                           // 'room_category',
                            [
                                'attribute'=>'room_category',
                                'value'=>'roomCategory.room_category'
                            ],
                            'charges_cash',
                            'charges_cashless',
                
                            ['class' => 'yiigridActionColumn'],
                        ],
                         'showFooter' => true
                    ]); ?>
                
                </div>
                

                Looking for some help on this one. Thanks.

                解决方案

                I think you just need to add the page summary;

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

                Kartik describes it pretty well in the demo and plugin details.

                这篇关于Yii2:Kartik Gridview 页脚中一列的总和的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:Yii2:如何使用联合查询和排序创建 ActiveDataProvid 下一篇:在 GridView Yii2 中对数据进行排序和过滤,其中列

                相关文章

                最新文章

              • <small id='XYdFO'></small><noframes id='XYdFO'>

                1. <legend id='XYdFO'><style id='XYdFO'><dir id='XYdFO'><q id='XYdFO'></q></dir></style></legend>
                  <i id='XYdFO'><tr id='XYdFO'><dt id='XYdFO'><q id='XYdFO'><span id='XYdFO'><b id='XYdFO'><form id='XYdFO'><ins id='XYdFO'></ins><ul id='XYdFO'></ul><sub id='XYdFO'></sub></form><legend id='XYdFO'></legend><bdo id='XYdFO'><pre id='XYdFO'><center id='XYdFO'></center></pre></bdo></b><th id='XYdFO'></th></span></q></dt></tr></i><div id='XYdFO'><tfoot id='XYdFO'></tfoot><dl id='XYdFO'><fieldset id='XYdFO'></fieldset></dl></div>

                  <tfoot id='XYdFO'></tfoot>
                    <bdo id='XYdFO'></bdo><ul id='XYdFO'></ul>