/** * Prepare global layout * Add renderers to \Magento\Framework\Data\Form * * @return $this */ protected function _prepareLayout() { parent::_prepareLayout(); \Magento\Framework\Data\Form::setElementRenderer($this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Form\\Renderer\\Element', $this->getNameInLayout() . '_element')); \Magento\Framework\Data\Form::setFieldsetRenderer($this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Form\\Renderer\\Fieldset', $this->getNameInLayout() . '_fieldset')); \Magento\Framework\Data\Form::setFieldsetElementRenderer($this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Form\\Renderer\\Fieldset\\Element', $this->getNameInLayout() . '_fieldset_element')); return $this; }
/** * Preparing global layout * * @return $this */ protected function _prepareLayout() { if ($this->getCustomerId()) { $button = $this->getLayout()->createBlock('Magento\\Backend\\Block\\Widget\\Button')->setData(['label' => __('Update Changes'), 'onclick' => 'order.sidebarApplyChanges()', 'class' => 'action-secondary', 'before_html' => '<div class="actions">', 'after_html' => '</div>']); $this->setChild('top_button', $button); } if ($this->getCustomerId()) { $button = clone $button; $button->unsId(); $this->setChild('bottom_button', $button); } return parent::_prepareLayout(); }