kartik-v / yii2-grid

Enhanced GridView with various utilities for Yii Framework 2.0
http://demos.krajee.com/grid
Other
557 stars 302 forks source link

v3.5.0 ExpandRowColumn stopped to work. #1021

Closed neoacevedo closed 2 years ago

neoacevedo commented 2 years ago

Prerequisites

Steps to reproduce the issue

I have configured the ExpandRowColumn in the following mode:

    [
        'class' => 'kartik\grid\ExpandRowColumn',
        'width' => '50px',
        'value' => function ($model, $key, $index) {
            return kartik\grid\GridView::ROW_COLLAPSED;
        },
        'detailRowCssClass' => GridView::TYPE_DEFAULT,
        // uncomment below and comment detail if you need to render via ajax
        // 'detailUrl' => Url::to(['/site/book-details']),
        'detail' => function (app\models\User $model, $key, $index, $column) {
            $dataProvider = new ActiveDataProvider([
                'query' => $model->getRutas(),
            ]);
            return GridView::widget(['dataProvider' => $dataProvider,
            'columns' => [
                    'id',
                    [
                        'attribute' => 'nombre',
                        'label' => 'Nombre'
                    ],
                    [
                        'label' => 'Conductor',
                        'value' => function (app\models\Ruta $model) {
                            return $model->conductor->nombreCompleto() ?? "";
                        }
                    ]
                ]
            ]);
        },
        'headerOptions' => ['class' => 'kartik-sheet-style'],
        'expandOneOnly' => true,
        'allowBatchToggle' => false
    ],

This column worked before the current (last) version, 3.5.0, but once I run composer update, the ExpandRowColumn stopped to work.

Expected behavior and actual behavior

When I follow those steps, when I do click in the expand icon in the desired row, it doesn't get expanded.

I was expecting the row was expanded to see the inner grid view.

Environment

Browsers

Operating System

Libraries

Isolating the problem

kartik-v commented 2 years ago

This seems specific caching issues to your environment which is causing old stale JS/CSS assets to be loaded. After installing new version - clear up your Yii2 Web runtime and web runtime assets folder --- and also CLEAN up your browser cache and restart and retry.

neoacevedo commented 2 years ago

Maybe the browser but I don't think so because I tried with 3 different browsers with the same result, because I don't have enabled the cache (it's configured with DummyCache), and just after to downgrade yii2.grid to the version 3.3.6 the expand row column worked again, but I will check if

RubenPHP commented 1 year ago

Same problem here. I solved it as follows: