I have created a form for my extension using this tutorial.
My problem is that I have no buttons (save, delete, etc) in my actions bar.
I can add Save and Continue Edit
, as the tutorial has, and this shows. However, the other default buttons are missing.
Below is my Edit.php
:
namespace Wildcard\QuantityGroups\Block\Adminhtml\Quantitygroups;
use Magento\Backend\Block\Widget\Context;
use Magento\Backend\Block\Widget\Form\Container;
use Magento\Framework\Registry;
class Edit extends Container
{
/** @var Registry $_coreRegistry */
protected $_coreRegistry;
public function __construct(
Context $context,
Registry $registry,
array $data = []
) {
$this->_coreRegistry = $registry;
parent::__construct($context, $data);
}
protected function _construct()
{
$this->_objectId = 'id';
$this->_blockGroup = 'Wildcard_QuantityGroups';
$this->_controller = 'adminhtml_quantitygroups';
$this->buttonList->add(
'save_and_continue',
[
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => ['event' => 'saveAndContinueEdit', 'target' => '#edit_form'],
],
]
],
10
);
if ($this->_coreRegistry->registry('quantityGroups_quantityGroup')->getId()) {
$this->buttonList->remove('reset');
}
}
public function getHeaderText()
{
if ($this->_coreRegistry->registry('quantityGroups_quantityGroup')->getId()) {
return __("Edit Quantity Group '%1'", $this->escapeHtml($this->_coreRegistry->registry('quantityGroups_quantityGroup')->getTitle()));
} else {
return __('New Quantity Group');
}
}
protected function _isAllowedAction($resourceId)
{
return $this->_authorization->isAllowed($resourceId);
}
protected function _getSaveAndContinueUrl()
{
return $this->getUrl('quantitygroups/actions/save', ['_current' => true, 'back' => 'edit', 'active_tab' => '']);
}
Can someone please let me know what I am missing? I have gone through core extensions and other tutorials to see what I might be missing, but cannot find it!
I am using Magento 2.1.5.
Please let me know if I need to share more code.