I have followed this solution Magento 2 : How to add a product grid in custom module using ui component? but i am getting this
What i am doing wrong can any one help me on this. Edit Controller
class Edit extends Action
{
protected $resultRawFactory;
/**
* @var \Magento\Framework\View\LayoutFactory
*/
protected $layoutFactory;
public function __construct(
Action\Context $context,
\Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
\Magento\Framework\View\LayoutFactory $layoutFactory
)
{
parent::__construct($context);
$this->_outfitFactory = $celebrityFactory;
$this->resultRawFactory = $resultRawFactory;
$this->layoutFactory = $layoutFactory;
}
/**
* Execute action based on request and return result
*
* Note: Request will be added as operation argument in future
*
* @return \Magento\Framework\Controller\ResultInterface|ResponseInterface
* @throws \Magento\Framework\Exception\NotFoundException
*/
public function execute()
{
try {
$resultRaw = $this->resultRawFactory->create();
return $resultRaw->setContents(
$this->layoutFactory->create()->createBlock(
'Allure\Celebrities\Block\Adminhtml\Products\Edit\Tab\Product',
'category.product.grid'
)->toHtml()
);
}
catch (\Exception $exception) {
$this->messageManager->addErrorMessage($exception->getMessage());
}
$this->_redirect("*/celebrities/index");
return;
}
protected function _initItem($getRootInstead = false)
{
$id = (int)$this->getRequest()->getParam('id', false);
$myModel = $this->_objectManager->create('Allure\Celebrities\Model\Celebrity');
if ($id) {
$myModel->load($id);
}
$this->_objectManager->get('Magento\Framework\Registry')->register('item', $myModel);
$this->_objectManager->get('Magento\Framework\Registry')->register('my_item', $myModel);
$this->_objectManager->get('Magento\Cms\Model\Wysiwyg\Config');
return $myModel;
}
}