当我尝试对子视图中的任何列进行排序时,视图将在kartik gridview中折叠为其原始状态。 Gridview的代码是 -
<?= GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'export' => false,
'columns' => [
[
'class' => 'kartik\grid\ExpandRowColumn',
'value' => function($model, $key, $index, $column){
return GridView::ROW_COLLAPSED;
},
'detail' => function($model, $key, $index, $column){
$searchModel = new ExpartiesSearch();
$searchModel-> parties_district = $model-> district;
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return Yii::$app->controller->renderPartial('_exparties', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
},
],
'district',
'sell',
'collection',
],
]); ?>
答案 0 :(得分:0)
也使用_exparties.php
中的Pjax,不带'id'。像这样:
Pjax::begin(['enablePushState' => false]);
...您的代码...
Pjax::end();
可能对其他人有用。