Consider module 'Bd_Demo' and Model 'Test'
Edit Grid Container File Test.php
public function __construct()
{
$this->_controller = 'adminhtml_test';
$this->_blockGroup = 'test';
$this->_headerText = Mage::helper('demo')->__('Test Manager');
$this->_addButtonLabel = Mage::helper('demo')->__('Add Test');
$this->_addButton('button1', array(
'label' => Mage::helper('demo')->__('Button Label1'),
'onclick' => "setLocation('".$this->getUrl('*/*/button1')."')",
));
$this->_removeButton('add'); // remove Add test button
parent::__construct();
}
Note : button1Action() method must be in admin controller
Edit Grid Container File Test.php
public function __construct()
{
$this->_controller = 'adminhtml_test';
$this->_blockGroup = 'test';
$this->_headerText = Mage::helper('demo')->__('Test Manager');
$this->_addButtonLabel = Mage::helper('demo')->__('Add Test');
$this->_addButton('button1', array(
'label' => Mage::helper('demo')->__('Button Label1'),
'onclick' => "setLocation('".$this->getUrl('*/*/button1')."')",
));
$this->_removeButton('add'); // remove Add test button
parent::__construct();
}
Note : button1Action() method must be in admin controller
Thanks Bhoopendra, Your post helped me
ReplyDeletegggggggggggggggg
ReplyDelete