public function init() { parent::init(); if (!$this->filterInputOptions['id']) { $this->filterInputOptions['id'] = $this->attribute; } if (!$this->filter && $this->grid->filterModel) { $this->filter = \Yii::createObject(['class' => $this->comboClass, 'attribute' => $this->attribute, 'model' => $this->grid->filterModel, 'formElementSelector' => 'td'])->run(); } }
public function init() { parent::init(); if (!empty($this->grid->filterModel)) { if (!$this->filterInputOptions['id']) { $this->filterInputOptions['id'] = $this->attribute; } if (!$this->filter) { $this->filter = AccountCombo::widget(['attribute' => $this->attribute, 'model' => $this->grid->filterModel, 'formElementSelector' => 'td']); } } }
/** * Sets visibility and default behaviour for value and filter when visible. */ public function init() { parent::init(); $this->visible = Yii::$app->user->can('support'); if (!$this->visible) { return; } if (!$this->sortAttribute) { $this->sortAttribute = $this->nameAttribute; } if ($this->value === null) { $this->value = function ($model) { return Html::a($model->{$this->nameAttribute}, ['@client/view', 'id' => $model->{$this->idAttribute}]); }; } if (!empty($this->grid->filterModel)) { if (!$this->filterInputOptions['id']) { $this->filterInputOptions['id'] = $this->attribute; } if (!$this->filter) { $this->filter = ClientCombo::widget(['attribute' => $this->attribute, 'model' => $this->grid->filterModel, 'formElementSelector' => 'td', 'clientType' => $this->clientType]); } } }