To display image in custom admin grid you need to add a column in grid.php with following code:
$this->addColumn('Database_Field_Name', array(
'header' => Mage::helper('ModuleName')->__('Image'),
'align' =>'left',
'type' => 'image',
'index' => 'Database_Field_Name',
'renderer' => 'modulename/adminhtml_modulename_renderer_image', //get the image HTML code class name in render class should be written in small lattercaps
'filter' => false,
'sortable' => false,
));
After that you need to create following image renderer file on module's BLock>Adminhtml>ModuleName>Renderer>Image.phpBlock/Adminhtml/ModuleName/Renderer/Image.php
location
<?php
class NameSpace_ModuleName_Block_Adminhtml_ModuleName_Renderer_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract{
public function render(Varien_Object $row) {
$html = '<img id="' . $this->getColumn()->getId() . '" src="'.Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$row->getData($this->getColumn()->getIndex()) . '"';
$html .= '/>';
return $html;
}
}
?>