Ust Grid in admin panel that looks like this: enter image description here

How can I remove the "Create New Item" button ?? Or assign another action to it?

Grid Container Designer:

 protected function _construct() { $helper = Mage::helper('brain_custommenu'); $this->_blockGroup = 'brain_custommenu'; $this->_controller = 'adminhtml_categorylist'; $this->_headerText = $helper->__('Category List'); $this->_addButtonLabel = $helper->__('Create New Item'); parent::_construct(); } 

Tried to do so , but the button is not removed!

Need a hint:

  1. How to remove this knop?
  2. How to assign another action ?

    2 answers 2

    All just delete the button and add custom

     protected function _construct() { $helper = Mage::helper('brain_custommenu'); $this->_blockGroup = 'brain_custommenu'; $this->_controller = 'adminhtml_categorylist'; $this->_headerText = $helper->__('Category List'); parent::_construct(); $this->_removeButton('add'); } 

    If you do not get through the code inspector, look at the id, and delete it. Next, add a button.

     $this->_addButton('add_new', array( 'label' => Mage::helper('catalog')->__('Add Product'), 'onclick' => "setLocation('{$this->getUrl('*/*/new')}')", 'class' => 'add' )); 
    • did so! The button does not disappear, in addition, the one that I create is added :( - Maybe_V
    • removeButton after constructs called? - Naumov
    • Yes, after the designer! - Maybe_V 8:43 pm
    • So id not add custom grid? - Naumov
    • No, not custom! I did everything as standard, in the code inspector for the Nana button id id_4b36c49816574f00c993e189eef5c2eb ! I tried to delete it, but it is not deleted at all :( - Maybe_V

    Delete button:

     $this->_removeButton('add'); 

    Or assign it another action:

     $this->_updateButton('add', 'onclick', $this->getUrl('*/*/newAction')); 

    The default button id is 'add'. If not removed, try clearing the cache. If that doesn't work, check the id in the parent classes.

    • You just deleted it. How can you update the deleted file? Naumov
    • corrected the text to make it clearer - Danil