PDA

View Full Version : Unable to see fields on tabpanel



Relexx
10 Mar 2009, 12:09 AM
Hi all,

I am stumped, and I don't know what is wrong.


Ext.onReady (function () {
Ext.QuickTips.init ();

var fp = new Ext.FormPanel ({
border: false
, closable: true
, title: 'New Form'
, labelWidth: 75
, bodyStyle:'padding: 5px 5px 0'
, url: '/'
, items: [
{
name: 'active'
, fieldLabel: 'Active'
, xtype: 'checkbox'
, hidden: false
}
, {
name: 'username'
, fieldLabel: 'username'
, width: 200
, hidden: false
, xtype: 'textfield'
}
]
, buttons: [
{
text: 'Save'
}
, {
text: 'Reset'
}
]
});

// fp.render (document.body);
var tp = new Ext.TabPanel({
renderTo: document.body
, width: 500
, height: 300
, border: true
, activeTab: 0
, items: [
fp
]
});
/**/
});

if I do not use the the TabPanel, instead use fp.render the form renders correctly. However when adding it to the TabPanel the fields do not render, only the buttons.

I can not see my problem. If somebody could please assist it would be greatly appreciated.

10 Mar 2009, 1:16 AM
add: layoutOnTabChange : true to your tab panel

Relexx
10 Mar 2009, 3:19 PM
Thanks ... that does not resolve the initial render issue though. I have worked around the problem by adding


{
title: 'home'
, html: 'home sweet home'
}
as the first tab, then selecting the New Form tab it is rendered ok.