I have followed this solution Magento 2 : How to add a product grid in custom module using ui component? but i am getting this

enter image description here

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
    $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(

    catch (\Exception $exception) {

protected function _initItem($getRootInstead = false)
    $id = (int)$this->getRequest()->getParam('id', false);
    $myModel = $this->_objectManager->create('Allure\Celebrities\Model\Celebrity');

    if ($id) {

    $this->_objectManager->get('Magento\Framework\Registry')->register('item', $myModel);
    $this->_objectManager->get('Magento\Framework\Registry')->register('my_item', $myModel);
    return $myModel;

  • I think the css file of page is not coming. Can you check the console and also try running content deploy, cache and indexing commands
    – surbhi agr
    May 9, 2019 at 7:07

1 Answer 1


Try this, it seems to be working http://www.webspeaks.in/2016/05/magento-2-add-products-grid-to-custom-admin-module.html


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.