'add_new', 'label' => __('Add New'), 'class' => 'add', 'button_class' => '', 'class_name' => 'Magento\Backend\Block\Widget\Button\SplitButton', 'options' => $this->_getAddButtonOptions(), ]; $this->buttonList->add('add_new', $addButtonProps); $this->setChild( 'grid', $this->getLayout()->createBlock('Emizentech\Banner\Block\Adminhtml\Banner\Grid', 'emizentech.banner.grid') ); return parent::_prepareLayout(); } /** * * * @return array */ protected function _getAddButtonOptions() { $splitButtonOptions[] = [ 'label' => __('Add New'), 'onclick' => "setLocation('" . $this->_getCreateUrl() . "')" ]; return $splitButtonOptions; } /** * * * @param string $type * @return string */ protected function _getCreateUrl() { return $this->getUrl( 'banner/*/new' ); } /** * Render grid * * @return string */ public function getGridHtml() { return $this->getChildHtml('grid'); } }