Yii Framework Forum: Help Extending Cgridcolumn Of Cgridview - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Help Extending Cgridcolumn Of Cgridview outside of framework Rate Topic: -----

#1 User is offline   Led 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 200
  • Joined: 16-January 12

Posted 09 April 2013 - 06:46 AM

can't extend cgridColumn of cgridview widget.


best way to do it?

I've extended

Yii::import('zii.widgets.grid.CGridView');
Yii::import('zii.widgets.CBaseListView');
Yii::import('application.extensions.CgridViewExt.CGridColumnExt');
Yii::import('application.extensions.CgridViewExt.CDataColumnExt');
Yii::import('application.extensions.CgridViewExt.CLinkColumnExt');
Yii::import('application.extensions.CgridViewExt.CButtonColumnExt');
Yii::import('zii.widgets.grid.CCheckBoxColumn');
/**
 * Description of CgridExt
 *
 * @author led
 */
class CgridExt extends CGridView{
    //put your code here
}


and the important part is


class CGridColumnExt extends CGridColumn{
    protected function renderFilterCellContent()
	{
            echo '<a href="'.Yii::app()->createUrl($this->grid->dataProvider->getId().'/create') .'" class="btn btn-primary addnew"><i class="icon-plus-sign"></i>Novo</a>';
		echo $this->grid->blankDisplay;
	}
}


but the renderFilterCellContent of the CgridExt isnot beeing call
0

#2 User is offline   le_top 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 315
  • Joined: 08-June 10
  • Location:France

Posted 10 April 2013 - 03:29 PM

CGridColumnExt will be used when you indicate it as the column class in the columns definition - importing it is not sufficient (nor needed if the class is on the "search path").
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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