DetailView::widget([
'model' => $model,
'condensed' => false,
'hover' => true,
'mode' => Yii::$app->request->get('edit') == 't' ? DetailView::MODE_EDIT : DetailView::MODE_VIEW,
'panel' => [
'heading' => $this->title,
'type' => DetailView::TYPE_INFO,
],
'attributes' => [
'name',
[
'attribute'=>'parentid',
'format'=>'raw',
'value'=>$model->parentid,
'type'=>DetailView::INPUT_SELECT2,
'widgetOptions'=>[
'data'=>ArrayHelper::map(Addevicearea::find()->orderBy('name')->asArray()->all(), 'areaid', 'name'),
'options' => ['placeholder' => '请选择'],
'pluginOptions' => ['allowClear'=>true, 'width'=>'100%'],
],
'valueColOptions'=>['style'=>'width:50%']
],
],
'deleteOptions' => [
'url' => ['delete', 'id' => $model->areaid],
],
'enableEditMode' => true,
])