Hi,
Trying to set filterHtmlOptions for a gridview and noticed the CDataColumn’s renderFilterCellContent() isn’t applying the filterHtmlOptions property. Can someone confirm this or am I being dumb?
https://github.com/y...aColumn.php#L95
Grid Code:
array(
'name' => 'category_id',
'filter' => CHtml::listData($categoryList, 'id', 'text'),
'filterHtmlOptions' => $categoryList,
'value' => '$data->category->buildParentsList()',
'htmlOptions' => array(
'class' => 'span5'
)
),
CDataColumn.php
protected function renderFilterCellContent()
{
if (is_string($this->filter))
echo $this->filter;
elseif ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos($this->name, '.') === false)
{
if (is_array($this->filter))
echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, array('id' => false, 'prompt' => ''));
elseif ($this->filter === null)
echo CHtml::activeTextField($this->grid->filter, $this->name, array('id' => false));
}
else
parent::renderFilterCellContent();
}
should be?
// Notice: ...'options' => $this->filterHtmlOptions
protected function renderFilterCellContent()
{
if (is_string($this->filter))
echo $this->filter;
elseif ($this->filter !== false && $this->grid->filter !== null && $this->name !== null && strpos($this->name, '.') === false)
{
if (is_array($this->filter))
echo CHtml::activeDropDownList($this->grid->filter, $this->name, $this->filter, array('id' => false, 'prompt' => '', 'options' => $this->filterHtmlOptions));
elseif ($this->filter === null)
echo CHtml::activeTextField($this->grid->filter, $this->name, array('id' => false));
}
else
parent::renderFilterCellContent();
}
Thanks,
Matt