PDA

View Full Version : Why it seems to have an infinite repetiton of el in an el



burton449
12 Sep 2014, 10:01 AM
I wonder why that:


var button = Ext.create('Ext.Button', {
id: 'Btn',
text: 'Button',
renderTo: 'Panel',
}).show();

console.log(Ext.getCmp('Btn'));

If you open the el of the object in the console, there is an exact copy of the button and in the el of the el there is another copy... and this seems to be infinite.

Why?

StuartAshworth
15 Sep 2014, 7:43 AM
I have tried this and the 'el' property contains the usual info that I'd expect.

I created a <div> element with an ID of "Panel" and then ran your code in the console.

50361

burton449
15 Sep 2014, 7:51 AM
Ok thanks for testing it. So there is something wrong with my application. See my print screen. Anybody knows what could be the cause?

50362

StuartAshworth
15 Sep 2014, 7:55 AM
That does seem strange. Could it be caused by conflicting IDs?Are the IDs and 'renderTo' part required? I would advise against using those if you can avoid it.