How to remove or rename button from grid in magento admin panel

Topics focus on Web Developments, Programming, Database, Digital Marketing Tutorials, Code Snippets, SEO, Social Media Marketing and Inspirational articles.

How to remove or rename button from grid in magento admin panel

How to remove or rename button from grid in magento admin panel

Here, We will explain How to remove or rename button from grid in magento admin panel?

Normally, the [Add New] button is present on upper right corner of Grid Page in Magento backend. If you don’t wish to show the [Add New] button in the Grid you need to code a little to disable it.

How to rename [Add New] button?

Go to grid page block file, the directory likes app -> code -> local -> YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile.php
Then add the following code to __construct function

1
2
//you can replace 'Add Report' with any text you want
$this->_addButtonLabel = Mage::helper('yourmodulename')->__('Add Report');

How to remove [Add New] button

Go to grid page block file, the directory likes app -> code -> local -> YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile.php
Then add the following code to __construct function(note: the remove statement code must be under the parent constructor statement)

1
2
parent::__construct();
$this->_removeButton('add');

Also, how to remove back, delete, and save button in edit page

Go to grid page block file, the directory likes app -> code -> local -> YourNamespace -> YourModule -> Block -> Adminhtml -> YourFile -> edit.php
Then add the following code to __construct function(note: the remove statement code must be under the parent constructor statement)

1
2
3
4
parent::__construct();
$this->_removeButton('delete');
$this->_removeButton('save');
$this->_removeButton('back');

Add comment


 

Pin It on Pinterest

Share This