mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-17 23:09:10 +08:00
Merge pull request #972 from cebe/grid-filter-only-active
Filter only active attributes in gridview
This commit is contained in:
@@ -115,7 +115,9 @@ class DataColumn extends Column
|
|||||||
{
|
{
|
||||||
if (is_string($this->filter)) {
|
if (is_string($this->filter)) {
|
||||||
return $this->filter;
|
return $this->filter;
|
||||||
} elseif ($this->filter !== false && $this->grid->filterModel instanceof Model && $this->attribute !== null) {
|
} elseif ($this->filter !== false && $this->grid->filterModel instanceof Model &&
|
||||||
|
$this->attribute !== null && $this->grid->filterModel->isAttributeActive($this->attribute))
|
||||||
|
{
|
||||||
if (is_array($this->filter)) {
|
if (is_array($this->filter)) {
|
||||||
$options = array_merge(array('prompt' => ''), $this->filterInputOptions);
|
$options = array_merge(array('prompt' => ''), $this->filterInputOptions);
|
||||||
return Html::activeDropDownList($this->grid->filterModel, $this->attribute, $this->filter, $options);
|
return Html::activeDropDownList($this->grid->filterModel, $this->attribute, $this->filter, $options);
|
||||||
|
|||||||
Reference in New Issue
Block a user