I want to remove the "Delete" mass action from the Products grid. I am trying to do this from my observer. Here is my observer class
class NameSpace_Module_Model_Observer {
public function isAddProductDeletePermitted($observer) {
$block = $observer->getBlock();
if( $block !== null ) {
if( $block instanceof Mage_Adminhtml_Block_Cms_Block_Grid) {
$block->getMassactionBlock()->removeItem('delete');
// echo "DELETE";
}
}
return $this;
}
And here is my config.xml
<?xml version="1.0"?>
<config>
. . .
<global>
. . .
<events>
<adminhtml_block_html_before>
<observers>
<is_add_product_form_permitted>
<class>Dotlocal_AdvProductGrid_Model_Observer</class>
<method>isAddProductDeletePermitted</method>
</is_add_product_form_permitted>
</observers>
</adminhtml_block_html_before>
</events>
</global>
</config>
I cannot seem to get this to work. I am pretty sure this doesn't work because I am trying to removing it before it is added. Then what event should I be observing?