Magento Certified Developer GuideCategory: 6. AdminhtmlWhat are column renderers used for in Magento
Manish Prakash Staff asked 3 years ago

Column Rendered are used in grid mainly to change display of how the grid content is displayed.
We can also specify custom renderer’s by creating custom classes which extend “Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract”

The important function in this is “render()” which return html text to be displayed inside a grid.

This is how we specify a custom renderer

$this->addColumn('Short description',
'header'=> Mage::helper('catalog')->__('Short description'),
'index' => 'short_description',
'renderer'  => 'Mage_Custom_Block_Catalog_Product_Renderer_Red',