Public Member Functions | |
render (Varien_Object $row) | |
getAttributesJson (Varien_Object $row) |
Definition at line 35 of file Checkbox.php.
getAttributesJson | ( | Varien_Object $ | row | ) |
Definition at line 49 of file Checkbox.php.
00050 { 00051 if(!$this->getColumn()->getAttributes()) { 00052 return '[]'; 00053 } 00054 00055 $result = array(); 00056 foreach($this->getColumn()->getAttributes() as $attribute) { 00057 $productAttribute = $attribute->getProductAttribute(); 00058 if($productAttribute->getSourceModel()) { 00059 $label = $productAttribute->getSource()->getOptionText($row->getData($productAttribute->getAttributeCode())); 00060 } else { 00061 $label = $row->getData($productAttribute->getAttributeCode()); 00062 } 00063 $item = array(); 00064 $item['label'] = $label; 00065 $item['attribute_id'] = $productAttribute->getId(); 00066 $item['value_index'] = $row->getData($productAttribute->getAttributeCode()); 00067 $result[] = $item; 00068 } 00069 00070 return Zend_Json::encode($result); 00071 }
render | ( | Varien_Object $ | row | ) |
Renders grid column
Varien_Object | $row |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Checkbox.
Definition at line 43 of file Checkbox.php.
00044 { 00045 $result = parent::render($row); 00046 return $result.'<input type="hidden" class="value-json" value="'.htmlspecialchars($this->getAttributesJson($row)).'" />'; 00047 }