PDA

View Full Version : renderTo not rendering components to div when present



cabennett85
5 Aug 2010, 2:12 PM
After creating an element via the DomHelper or by hard coding it in the body, I am rendering panels into that div.
The problem is that I am not able to add items to the constructor (app.ui.GameSlidePanelContent) when the renderTo config is present.
Removing renderTo causes the items to appear. Any thoughts as to when renderTo is behaving in this manner?


var dh = Ext.DomHelper;
var gamePanel = dh.insertAfter('scroller', {
tag: 'div',
id: 'gamePanel',
cls: 'game_panel_closed'
});



app.ui.GameSlidePanelContent = Ext.extend(Ext.Panel, {
cls: 'gameContent',
renderTo: 'gamePanel',
items: [{html: 'foo'}]
...

evant
5 Aug 2010, 5:15 PM
Don't put items in the prototype. It means they get shared across every object instance.

If you say that you'll only ever use it once, why are you creating a new class?!?!