PDA

View Full Version : [CLOSED-188] Adding formpanel to panel ofter the panel has been created and rendered.



jeroenvduffelen
19 Jun 2010, 3:31 PM
First of all.. this stuff is so cool!

First off all i'm setting up my basic stuff for the webapp with this code (like in the example of kitchensink)



Ext.ns('wsApp', 'Ext.ws');

Ext.ws.UniversalUI = Ext.extend(Ext.Panel, {
fullscreen: true,
layout: 'card',
initComponent: function(){
Ext.ws.UniversalUI.superclass.initComponent.call(this);
},
});

wsApp.app = {
fnInit: function(){
this.ui = new Ext.ws.UniversalUI();
wsApp.devise.fnInit();
}
}

Ext.setup({
onReady: function(){
wsApp.app.fnInit();
}
});


But... I'm running into a little problem. I have created a Panel called panelLogin which I render to the screen with wsApp.app.ui.setCard. After rendering I want to add a FormPanel called formpanelLogin:



this.panelLogin.add(formpanelLogin);
this.panelLogin.doLayout();
console.log(formpanelLogin.rendered);


The log returns true for the formpanelLogin being rendered.. but it isnt vissible.

I attached the code as an attachement. Any help would be cool!

meyerovb
23 Jul 2010, 3:06 AM
Fit layout panels need to have dimension in order to 'fit' an item inside them, so you would need to give panelLogin a height in order for anything to be displayed in it (fit panels should have only 1 item, although they can have multiple dockedItems).

Having said that, I do think you found a bug. In the below example, the auto layout panel has it's button replaced correctly, while the fit layout panel has it's button removed, but the new one is not rendered.



Ext.setup({ onReady: function () {
var button =
{
xtype: 'button',
text: 'Click me',
handler: function () {
var panel = this.ownerCt;
panel.remove(this);
panel.add({ xtype: 'button', text: 'Button2' });
panel.doLayout();
}
};
new Ext.Panel({ fullscreen: true,
items: [{ items: [button] },
{
items: [button],
layout: 'fit',
height: 50
}]
});
}
});

Jamie Avins
30 Jul 2010, 10:26 AM
I've opened the issue in trac, thank you for the report.

evant
14 Aug 2010, 5:22 AM
I'm not able to reproduce this, using the latest build, so I think we can close this off.