PDA

View Full Version : alignTo throws exception



stevebla
22 Mar 2013, 1:02 PM
LoadMask displays OK in center of screen when no attempt to align.

When I try to align it to a static div it fails with...

TypeError: Cannot call method 'getAlignToXY' of undefined

Extjs 4.1.1

Chrome V25 (same in FF)

Here is the code...


ProgressStart: function(txt)
//////////////////////////////////////////////////////////////////
{
lmask = new Ext.LoadMask(Ext.getBody(),
{ msg:txt});
lmask.show();
var elem=document.getElementById("orsloadmask");
try
{
lmask.alignTo("orsloadmask","tl-l",[100,0]);
}
catch(e){say("util:174 error on ProgressStart, element=<"+elem+">:"+e);}
}

Note: The catch handler displays the elem as [object HTMLDivElement], i.e. it is defined

...I have spent a lot of time with this today...it is frustrating :(

mitchellsimoens
25 Mar 2013, 7:56 AM
That will mean that something isn't rendered. Why not send the element you want to show the load mask instead of Ext.getBody()?