I loaded custom js in head section of grid ui component in order to open a model dialog box when i click a button.

], function($, modal){

var options = {
    type: 'popup',
    responsive: true,
    innerScroll: true,
    title: 'Title',
    buttons: [{
        text: $.mage.__('Proceed'),
        class: '',
        click: function () {
            /* some stuff */
var popup = modal(options,$('#popup-modal'));


Its throw an following error when page load

jquery.js:3762 Uncaught TypeError: Cannot read property 'nodeName' of undefined

can any one suggest please.


1 Answer 1


add this code you will resolve the problem

if ($("#popup-modal").length != 0) {

var popup = modal(options, $('#popup-modal')); 



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.