i need to add a custom button on admin sales order grid page like this:
I'm trying to create a module for this using this code in my config.xml file:
<adminhtml>
<events>
<adminhtml_widget_container_html_before>
<observers>
<crononline>
<class>crononline/observer</class>
<method>addNewButton</method>
<type>singleton</type>
</crononline>
</observers>
</adminhtml_widget_container_html_before>
</events>
</adminhtml>
and then add button by observer in this way
public function addNewButton($observer)
{
$container = $observer->getBlock();
if(null !== $container && $container->getType() == 'adminhtml/sales_order') {
$data = array(
'label' => 'My button',
'class' => 'some-class',
'onclick' => 'setLocation(\' ' . Mage::getUrl('*/*', array('param' => 'value')) . '\')',
);
$container->addButton('my_button_identifier', $data);
}
return $this;
}
but with no luck.
Any help?