many times we need to do operation on two column values and show in the admin panel. for this we have to follow these steps:
1. Add column in your Grid.php file:
addColumn('newcolumn', array(
'header' = Mage::helper('core')->__('NewColumn'),
'align' = 'left',
'index' = 'created_at',
'type' = 'action',
'renderer' = new Namespace_Module_Block_Adminhtml_Renderer_Qty(),
));
?>
2. Now create a folder in the AdminHtml folder with name ‘Renderer’
3. Create a new php file with name ‘Qty.php’
4. Write below code in the Qty.php file:
getQty() - $row->getMinQty();
return $remainingvalue;
}
}
?>
Ref: http://www.magentocommerce.com/boards/viewthread/192232/#t239222
That’s all.
Leave a Reply