liaoron 2016-12-08 21:41:48 500次浏览 0条回复 1 0 0

公司底下显示联系方式(1家公司对应几个联系方式):
index.php:
'columns' 内:

[
     'class'=>'kartik\grid\ExpandRowColumn',
     //'width'=>'50px',
     'value'=>function ($model, $key, $index, $column) {
         return GridView::ROW_COLLAPSED;
     },

     'detail'=> function($model,$key,$index,$column) {
         $searchModel = new \backend\models\CnContactSearch();
         $searchModel->cn_company_id = $model->id;
         $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
         return Yii::$app->controller->renderPartial('/cn-contact/index',[
             'searchModel'=> $searchModel,
             'dataProvider'=>$dataProvider,
           ]);
        },
     //'detailUrl' => \yii\helpers\Url::to(['/cn-company/detail-contacts']),
     'detailAnimationDuration'=>100,
     //'expandIcon'=>'<span class="fa fa-angle-right"></span>',
     //'collapseIcon'=>'<span class="fa fa-angle-down"></span>',
     'headerOptions'=>['class'=>'kartik-sheet-style'],
     'expandOneOnly'=>true
    ],

悦分析,共成长!
QQ 70467177,高手可加

    没有找到数据。
您需要登录后才可以回复。登录 | 立即注册
在线
980