Skip to content

Commit

Permalink
Combo for GridView filter, process
Browse files Browse the repository at this point in the history
  • Loading branch information
tafid committed May 19, 2015
1 parent df52073 commit e693b42
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
32 changes: 21 additions & 11 deletions views/ticket/_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,29 @@
]); ?>
</div>
<?= $form->field($model, 'state')->widget(StaticCombo::classname(), [
'data' => array_merge(['' => ''], $state_data),
'data' => $state_data,
]); ?>
</div>

<div class="col-md-4">
<?= $form->field($model, 'author_id')->widget(ClientCombo::classname()); ?>

<?= $form->field($model, 'responsible_id')->widget(ClientCombo::classname(), [
'clientType' => 'manager'
'clientType' => 'manager',
// 'pluginOptions' => [
// 'select2Options' => [
// 'multiple' => true,
// ],
// ],
]); ?>

<?= $form->field($model, 'topics')->widget(StaticCombo::classname(), [
'data' => array_merge(['' => ''], $topic_data),
'data' => $topic_data,
'pluginOptions' => [
'select2Options' => [
'multiple' => true,
]
],
]); ?>
</div>

Expand All @@ -78,18 +88,18 @@
]); ?>

<?= $form->field($model, 'priority')->widget(StaticCombo::classname(), [
'data' => array_merge(['' => ''], $priority_data),
'data' => $priority_data,
]);?>

<?php echo $form->field($model, 'watchers')->widget(ClientCombo::classname()); ?>
<?php echo $form->field($model, 'watchers')->widget(ClientCombo::classname(), [
// 'pluginOptions' => [
// 'select2Options' => [
// 'multiple' => true,
// ],
// ],
]); ?>
</div>


<?php // echo $form->field($model, 'message') ?>

<?php // echo $form->field($model, 'answer_message') ?>


<div class="col-md-12">
<?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
Expand Down
10 changes: 7 additions & 3 deletions views/ticket/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,18 @@
[
'attribute' => 'responsible_id',
'format' => 'html',
'filterInputOptions' => ['id' => 'responsible_id'],
// 'filterInputOptions' => ['id' => 'responsible_id'],
'value' => function ($data) {
return Html::a($data['responsible'], ['/client/client/view', 'id' => $data->responsible_id]);
},
'filter' => Select2::widget([
'filter' => \hipanel\modules\client\widgets\combo\ClientCombo::widget([
'attribute' => 'responsible_id',
'model' => $searchModel,
'url' => Url::to(['/client/client/client-all-list'])
'formElementSelector' => 'td',
'inputOptions' => [
'id' => 'responsible_id',
]
// 'url' => Url::to(['/client/client/client-all-list'])
]),
],
[
Expand Down

0 comments on commit e693b42

Please sign in to comment.