Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

javascript Uncaught TypeError: Cannot read property 'dom' of null

hi experts

when i use a code something like this in my javascript

var customerImg = Ext.create('Ext.Img', {
    src: 'images/customer.png',  
    width: 14,
    height: 14,    
    margin : '0 0 0 5',
    //renderTo: Ext.getBody(),
    listeners: {
        afterrender: function(c) {
            Ext.create('Ext.tip.ToolTip', {
                target: c.getEl(),
                html: 'This   represents customer delays.'
            });
        }
    }
});


{
xtype: customerImg 
},

Open in new window



I end up getting error >> Uncaught TypeError: Cannot read property 'dom' of null


any idea whats wrong with the above code ?
When i comment out the above code the error goes away.

( I am using  Ext-js 4.2 )

thanks.
ASKER CERTIFIED SOLUTION
Avatar of Pravin Asar
Pravin Asar
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Roy

ASKER

Thanks . My code works fine the first time. When I close the window and open the window second time that is when I get the cannot read property Dom of null error.

Anu idea why my code gives this error only on second time?
Avatar of Jay Roy

ASKER

modified my code as per yours, seems fine now
thanks
Thanks for the points.
Avatar of Jay Roy

ASKER

hi pravinasar

Will appreciate any help with my next question
https://www.experts-exchange.com/questions/28529299/passing-list-from-UI-to-spring-MVC-controller.html

thanks.
By the time, I looked at, it is deleted.

Thanks