If you don’t want to show the ‘Add New’ button in the Grid. The Add New button is present in top right corner of Grid Page.
Rename ‘Add New’ button
Here are the steps to rename the ‘Add New’ text to anything you required (for example, ‘Add Report’):-
- Go to YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile.php
- Add the following code in the constructor of this file:-
$this->_addButtonLabel = Mage::helper('yourmodulename')->__('Add Report');
Remove ‘Add New’ button
Here are the steps to remove the ‘Add New’ button:-
- Go to YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile.php
- Add the following code in the constructor of this file (it should be just below the call to parent constructor):-
parent::__construct();
$this->_removeButton('add');
In edit.php
parent::__construct();
$this->_removeButton('delete');
$this->_removeButton('save');
$this->_removeButton('back');
in grid.php
parent::__construct();
$this->_removeButton('add');
No comments:
Post a Comment