CGridColumn::filterHtmlOptions - missing property?

Hello.

There are some properties in CGridColumn for adding special html options:




/**

 * @var array the HTML options for the data cell tags.

 */

public $htmlOptions=array();

 

/**

 * @var array the HTML options for the header cell tag.

 */

public $headerHtmlOptions=array();

  

/**

 * @var array the HTML options for the footer cell tag.

 */

public $footerHtmlOptions=array();



But there is no such property for filter cells. It can be implemented like this:




/**

 * @var array the HTML options for the filter cell tag.

 */

public $filterHtmlOptions=array();


/**

 * Renders the filter cell.

 */

public function renderFilterCell() {

  echo CHtml::openTag('td', $this->filterHtmlOptions);

  $this->renderFilterCellContent();

  echo "</td>";

}



For example, without this you cannot hide column with style="display:none;" (filter cell will be visible).

Thanks for this info.

It helped me save lot of frustration. I feel that this feature should have been implemented in Yii itself, rather than having us modify the inbuilt Yii files.

If you don’t want the filter for a specific column… you can set it’s filter property to false - http://www.yiiframework.com/doc/api/1.1/CDataColumn#filter-detail

Yes, but this has the effect of rendering


<td>&nbsp;</td>

, when you might sometimes want to hide the entire cell instead.