Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options:

Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract Mage_Adminhtml_Block_Abstract Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 render (Varien_Object $row)


Detailed Description

Definition at line 34 of file Options.php.


Member Function Documentation

render ( Varien_Object row  ) 

Render a grid cell as options

Parameters:
Varien_Object $row
Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.

Definition at line 42 of file Options.php.

00043     {
00044         $options = $this->getColumn()->getOptions();
00045         $showMissingOptionValues = (bool)$this->getColumn()->getShowMissingOptionValues();
00046         if (!empty($options) && is_array($options)) {
00047             $value = $row->getData($this->getColumn()->getIndex());
00048             if (is_array($value)) {
00049                 $res = array();
00050                 foreach ($value as $item) {
00051                     if (isset($options[$item])) {
00052                         $res[] = $options[$item];
00053                     }
00054                     elseif ($showMissingOptionValues) {
00055                         $res[] = $item;
00056                     }
00057                 }
00058                 return implode(', ', $res);
00059             }
00060             elseif (isset($options[$value])) {
00061                 return $options[$value];
00062             }
00063             return '';
00064         }
00065     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:09 2009 for Magento by  doxygen 1.5.8