in magento 1 for open window we use this code

<a href="" onclick="popWin('<?php echo Mage::getUrl('example/order/orderitems') ?>', 
                        'gallery', 'width=1500,height=700,left=0,top=0,location=no,status=yes,scrollbars=yes,resizable=yes'); return false;" ><?php echo $this->__('Items Ordered');?> </a>

In magento 2 how can i open popup window on click in admin panel?

1 Answer 1


In your module view > adminhtml

in requirejs-config.js

var config = {
map: {
    '*': {
            'popupWindow':  'mage/popup-window',

In your template file

<a href="#"
   data-mage-init='{"popupWindow": {"windowURL":"<?php echo $this->getUrl('example/order/orderitems')?>","windowName":"orderitems","width":1500,"height":700,"top":0,"left":0,"resizable":1,"scrollbars":1}}'
   title="<?php /* @escapeNotVerified */ echo __('Item Order') ?>"
   class="action-default scalable add primary">
    <span><?php /* @escapeNotVerified */ echo __('Item order') ?></span>

This code is working for me

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.