Yii Framework Forum: CGridColumn::filterHtmlOptions - missing property? - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

CGridColumn::filterHtmlOptions - missing property? Rate Topic: -----

#1 User is offline   kiaplayer 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 16-February 11

Posted 19 June 2011 - 01:07 PM

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).
0

#2 User is offline   Mohit 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 06-July 11

Posted 14 July 2011 - 01:10 AM

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.
0

#3 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,543
  • Joined: 12-October 09
  • Location:Croatia

Posted 14 July 2011 - 05:21 AM

If you don't want the filter for a specific column... you can set it's filter property to false - http://www.yiiframew...n#filter-detail
Find more about me.... btw. Do you know your WAN IP?
0

#4 User is offline   regularmike 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 14-August 13

Posted 03 March 2015 - 12:30 PM

Yes, but this has the effect of rendering
<td>&nbsp;</td>
, when you might sometimes want to hide the entire cell instead.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users