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
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');
}
...