Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Radio Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Radio:

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

 getValues ()
 render (Varien_Object $row)

Protected Attributes

 $_defaultWidth = 55
 $_values


Detailed Description

Definition at line 34 of file Radio.php.


Member Function Documentation

getValues (  ) 

Definition at line 39 of file Radio.php.

00040     {
00041         if (is_null($this->_values)) {
00042             $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : array();
00043         }
00044         return $this->_values;
00045     }

render ( Varien_Object row  ) 

Renders grid column

Parameters:
Varien_Object $row
Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.

Definition at line 52 of file Radio.php.

00053     {
00054         $values = $this->getColumn()->getValues();
00055         $value  = $row->getData($this->getColumn()->getIndex());
00056         if (is_array($values)) {
00057             $checked = in_array($value, $values) ? ' checked="checked"' : '';
00058         }
00059         else {
00060             $checked = ($value === $this->getColumn()->getValue()) ? ' checked="checked"' : '';
00061         }
00062         return '<input type="radio" name="'.$this->getColumn()->getHtmlName().'" value="' . $row->getId() . '" class="radio"'.$checked.'/>';
00063     }


Member Data Documentation

$_defaultWidth = 55 [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.

Definition at line 36 of file Radio.php.

$_values [protected]

Definition at line 37 of file Radio.php.


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