Yii Framework Forum: Extension CGridView - Yii Framework Forum

Jump to content

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

Extension CGridView Rate Topic: -----

#1 User is offline   dimasnake 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 03-March 10

Posted 03 March 2010 - 08:05 AM

I create extention CGridView
 
   Yii::import('zii.widgets.grid.CGridView');

   class MyCGridView extends CGridView
    {
            public function renderTableRow($row)
            {
            if($this->rowCssClassExpression!==null)
                            echo '<tr class="'.$this->evaluateExpression($this->rowCssClassExpression,array('row'=>$row)).'">';
                    else if(is_array($this->rowCssClass) && ($n=count($this->rowCssClass))>0)
                            echo '<tr class="'.$this->rowCssClass[$row%$n].'">';
                    else
                            echo '<tr>';
                    foreach($this->columns as $column)
                            $column->renderDataCell($row);
                    echo "</tr>\n";
                    
            }
    } 



    $this->widget('ext.CGridView', array(.....)); 


But not override the function renderTableRow. Why?
0

#2 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 756
  • Joined: 02-February 09

Posted 03 March 2010 - 10:02 AM

$this->widget('ext.MyCGridView', array(.....)); 

may be ???
0

#3 User is offline   dimasnake 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 03-March 10

Posted 05 March 2010 - 07:41 AM

Tnk, it works.
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