On a backend admin page with a grid I need to change the background color for groups of rows. Not alternate color row by row as default but coloring groups according to a kn
The answers above are good, but sometimes you want to do the same thing without creating a new file.
Here is another way to achieve the same result remaining in the grid file.
$this->addColumn('collision_type', array(
'header' => $helper->__('Collision'),
'align' => 'center',
'index' => 'collision_type',
'type' => 'action',
'frame_callback' => [$this, '_formatCell']
));
then in the same file
public function _formatCell($value, Varien_Object $row, Mage_Adminhtml_Block_Widget_Grid_Column $column)
{
$value = $row->getData($column->getIndex());
return ''.$value.'';
}