0

I am extending the \Magento\Backend\Block\Widget\Grid\Container with my block, and I want to remove the button for adding new instances of this model ("MODEL"). How can I do that?

1 Answer 1

0

Call removeButton('add') from the _construct method of your Adminhtml Block file ...

app\code\YourSpace\YourModule\Block\Adminhtml\Whatever.php

namespace YourSpace\YourModule\Block\Adminhtml;

protected function _construct()
{
    ...

    parent::_construct();

    $this->removeButton('add');
}

...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.