PDA

View Full Version : [FIXED] Component.showBy always expects an Ext.Component as reference element



r_honey
4 Dec 2011, 10:36 AM
var pnl=new Ext.Panel({html:'Some content'});
pnl.showBy(Ext.getBody());


The above code generates an exception. showBy only accepts an Ext.Component, passing Ext.Element throws an error: "Cannot read property "dom" of undefined".

And I believe the problem lies in this line of Ext.Component.alignTo:



var g = h.element,


I believe Ext.Components have a element property, but Ext.Element don't have it.

r_honey
4 Dec 2011, 10:40 AM
Changing that line in alignTo method should make it work:



var alignElement = alignTo.element || alignTo,

Jamie Avins
5 Dec 2011, 9:20 AM
Thank you for the report.

mitchellsimoens
11 Dec 2011, 6:26 PM
Until this gets fixed, you can fake it:


panel.showBy({
element : el
});

Jacky Nguyen
26 Jan 2012, 9:18 PM
This has been addressed in the next release (beta 1).

r_honey
26 Jan 2012, 11:19 PM
Great, thanks Jacky!!!

jweber
5 Nov 2012, 11:06 AM
The documentation doesn't indicate that you can use an Element instead of a Component. Should probably be updated.