Closed santilin closed 4 years ago
Can you please share your gridview and column configuration?
This is the configuration that is not grouped, so the page summary is shown:
<?php
/* @var yii\web\View $this */
/* @var app\models\ExpedienteSearch $searchModel */
/* @var app\models\... $parent */
/* @var array $gridParams */
/* @var array $extraParams */
use yii\helpers\Html;
use yii\helpers\Url;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
$gridColumns = [
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {view} {delete}',
],
'codigo' => [ // code
'attribute' => 'codigo',
],
'destino' => [ // dropdown
'attribute' => 'destino',
'group' => false,
'groupedRow' => false,
'value' => 'DestinoLabel' ],
'cantidad_ofertada' => [ // NUMBER
'pageSummary' => true,
'pageSummaryFunc' => GridView::F_COUNT,
'attribute' => 'cantidad_ofertada',
'format' => 'currency',
'hAlign' => 'right' ],
'horas_previstas' => [ // NUMBER
'attribute' => 'horas_previstas',
'pageSummary' => true,
'pageSummaryFunc' => GridView::F_SUM,
'format' => 'hours',
'hAlign' => 'right' ],
];
$dataProvider = $searchModel->search($gridParams);
$gridOptions = [
'dataProvider' => $dataProvider,
'columns' => $gridColumns,
'showPageSummary' => true,
'itemLabelSingle' => 'Expediente',
'itemLabelPlural' => 'Expedientes',
'pjax' => true,
'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container-field']],
'panel' => [
'type' => GridView::TYPE_PRIMARY,
'heading' => '<span class="glyphicon glyphicon-book"></span> ' . Html::encode($this->title)],
'condensed' => true,
'hover' => true,
];
?>
<div class='expediente-index'>
<?= GridView::widget( $gridOptions ) ?>
</div><!-- expediente-index -->
<?php
And this is the same one with the destino
column grouped, that removes the summary row:
<?php
/* @var yii\web\View $this */
/* @var app\models\ExpedienteSearch $searchModel */
/* @var app\models\... $parent */
/* @var array $gridParams */
/* @var array $extraParams */
use yii\helpers\Html;
use yii\helpers\Url;
use kartik\grid\GridView;
use kartik\export\ExportMenu;
$gridColumns = [
[
'class' => 'yii\grid\ActionColumn',
'template' => '{update} {view} {delete}',
],
'codigo' => [ // code
'attribute' => 'codigo',
],
'destino' => [ // dropdown
'attribute' => 'destino',
'group' => true,
'groupedRow' => true,
'value' => 'DestinoLabel' ],
'cantidad_ofertada' => [ // NUMBER
'pageSummary' => true,
'pageSummaryFunc' => GridView::F_COUNT,
'attribute' => 'cantidad_ofertada',
'format' => 'currency',
'hAlign' => 'right' ],
'horas_previstas' => [ // NUMBER
'attribute' => 'horas_previstas',
'pageSummary' => true,
'pageSummaryFunc' => GridView::F_SUM,
'format' => 'hours',
'hAlign' => 'right' ],
];
$dataProvider = $searchModel->search($gridParams);
$gridOptions = [
'dataProvider' => $dataProvider,
'columns' => $gridColumns,
'showPageSummary' => true,
'itemLabelSingle' => 'Expediente',
'itemLabelPlural' => 'Expedientes',
'pjax' => true,
'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container-field']],
'panel' => [
'type' => GridView::TYPE_PRIMARY,
'heading' => '<span class="glyphicon glyphicon-book"></span> ' . Html::encode($this->title)],
'condensed' => true,
'hover' => true,
];
?>
<div class='expediente-index'>
<?= GridView::widget( $gridOptions ) ?>
</div><!-- expediente-index -->
<?php
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is a preliminary bug report, if you need a working sample I can do it, but I think the error es pretty easy to reproduce.
When I define a grid with
showPageSummary=true
and a few columns withpageSummary=true
I get a grid with an extra row for the summary columns.But when I set a column to be grouped:
group=true
, the summary row dissapears due to this code inkv-grid-group.js
:If I comment out the
$td.remove()
line, the summary row stays.