Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox:

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 Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid_Renderer_Checkbox Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Giftmessage Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Massaction

List of all members.

Public Member Functions

 getValues ()
 render (Varien_Object $row)
 renderHeader ()

Protected Member Functions

 _getCheckboxHtml ($value, $checked)

Protected Attributes

 $_defaultWidth = 55
 $_values


Detailed Description

Definition at line 34 of file Checkbox.php.


Member Function Documentation

_getCheckboxHtml ( value,
checked 
) [protected]

Reimplemented in Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Massaction.

Definition at line 71 of file Checkbox.php.

00072     {
00073         return '<input type="checkbox" name="'.$this->getColumn()->getFieldName().'" value="' . $value . '" class="'. ($this->getColumn()->getInlineCss() ? $this->getColumn()->getInlineCss() : 'checkbox' ).'"'.$checked.'/>';
00074     }

getValues (  ) 

Definition at line 39 of file Checkbox.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.

Reimplemented in Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid_Renderer_Checkbox, Mage_Adminhtml_Block_Sales_Order_Create_Search_Grid_Renderer_Giftmessage, and Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Massaction.

Definition at line 52 of file Checkbox.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     if ($this->getNoObjectId() || $this->getColumn()->getUseIndex()){
00063         //WTF: why getNoObjectId???
00064         $v = $value;
00065     } else {
00066             $v = ($row->getId() != "") ? $row->getId():$value;
00067     }
00068         return $this->_getCheckboxHtml($v, $checked);
00069     }

renderHeader (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.

Reimplemented in Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Massaction.

Definition at line 76 of file Checkbox.php.

00077     {
00078         if($this->getColumn()->getHeader()) {
00079             return parent::renderHeader();
00080         }
00081 
00082         $checked = '';
00083         if ($filter = $this->getColumn()->getFilter()) {
00084             $checked = $filter->getValue() ? 'checked="checked"' : '';
00085         }
00086         return '<input type="checkbox" name="'.$this->getColumn()->getFieldName().'" onclick="'.$this->getColumn()->getGrid()->getJsObjectName().'.checkCheckboxes(this)" class="checkbox" '.$checked.' title="'.Mage::helper('adminhtml')->__('Select All').'"/>';
00087     }


Member Data Documentation

$_defaultWidth = 55 [protected]

$_values [protected]

Definition at line 37 of file Checkbox.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