add filters, some improvements
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
|
||||
use backend\modules\project\models\ProjectUser;
|
||||
use backend\modules\task\models\Task;
|
||||
use kartik\select2\Select2;
|
||||
use yii\helpers\Html;
|
||||
use yii\grid\GridView;
|
||||
|
||||
@ -30,14 +31,38 @@ $this->params['breadcrumbs'][] = $this->title;
|
||||
|
||||
[
|
||||
'attribute' => 'task_id',
|
||||
'filter' => Task::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'value' => 'task.title'
|
||||
'value' => 'task.title',
|
||||
'filter' => Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'task_id',
|
||||
'data' => Task::find()->select(['title', 'id'])->indexBy('id')->column(),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'width' => '250px',
|
||||
],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'Выберите значение'
|
||||
],
|
||||
])
|
||||
],
|
||||
[
|
||||
'attribute' => 'project_user_id',
|
||||
'filter' => ProjectUser::find()->select(['user.username', 'project_user.id'])
|
||||
->joinWith('user')->indexBy('project_user.id')->column(),
|
||||
'value' => 'projectUser.user.username'
|
||||
'value' => 'projectUser.user.username',
|
||||
'filter' => Select2::widget([
|
||||
'model' => $searchModel,
|
||||
'attribute' => 'project_user_id',
|
||||
'data' => ProjectUser::find()->select(['user.username', 'project_user.id'])
|
||||
->joinWith('user')->indexBy('project_user.id')->column(),
|
||||
'pluginOptions' => [
|
||||
'allowClear' => true,
|
||||
'width' => '250px',
|
||||
],
|
||||
'options' => [
|
||||
'class' => 'form-control',
|
||||
'placeholder' => 'Выберите значение'
|
||||
],
|
||||
])
|
||||
],
|
||||
|
||||
['class' => 'yii\grid\ActionColumn'],
|
||||
|
Reference in New Issue
Block a user