I got a url to my custom product listing.

<?xml version="1.0"?>
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<container name="content">
    <uiComponent name="products_listing" />
</container>

I want this page to be loaded in my modal popup. So i created a ajax request to the url

$.ajax({
        type: 'POST',
        url: '/{backend}/quotesystem/ajax/purchaseitems',
        data: quoteData,
        dataType: 'html',
        beforeSend: function () {
            $('body').loader('show');
        },
        success: function (result) {

            var popup = modal(options, $('.popup-add-product-quotation'));
            $(".popup-add-product-quotation").modal("openModal");
        },
        complete: function () {
            $('body').loader('hide');
        }
    });

This loads the entire page, but i get console errors and the page will not load inside my modal.

jquery.js:9747 Uncaught TypeError: require.exec is not a function
at window.define (mixins.js:254)
at eval (eval at <anonymous> (jquery.js:349), <anonymous>:5:1)
at eval (<anonymous>)
at jquery.js:349
at Function.globalEval (jquery.js:350)
at text script (jquery.js:10372)
at ajaxConvert (jquery.js:9332)
at done (jquery.js:9789)
at callback (jquery.js:10311)
at Object.send (jquery.js:10321)

This is what i return in my controller:

 public function execute()
{
    $pageFactory = $this->resultPageFactory->create();
    return $pageFactory;
}

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.