Find us on facebook

Aug 21, 2014

Many to Many relationship shown in the grid

In Controller
protected function gridCategoryDescription($data,$row)
    {
       return $this->_lastProductId != $data->id ? $data->discription : '';          
    }

protected function gridCategoryPrice($data,$row)
    {
        if($this->_lastProductId != $data->id)
        {
            $this->_lastProductId = $data->id;
            return $data->code;
        }
        else
             return '';
    }

In view
array(            
'name'=>'discription',
'value'=>array($this,'gridCategoryDescription')
),

array(            
'name'=>'code',
'value'=>array($this,'gridCategoryPrice')
),

No comments:

Post a Comment