PDA

View Full Version : more windows, tabpanels, and forms



jasonb885
13 Oct 2010, 3:44 PM
The JavaScript below produces the attached image. What's the correct way to do it so there is no horizontal scrollbar? Using ExtJS 3.2.1. Thank you.



Ext.onReady(function() {
var tp = {
xtype:'tabpanel',
defaultType:'container',
autoScroll:true,
deferredRender:false,
layoutOnTabChange:true,
activeTab:0,
defaults:{
layout:'form'
},
items:[
{
title:'tab',
defaultType:'textfield',
//defaults:{anchor:'-20'},
items:[
{fieldLabel:'lame', name:'lame'},
{fieldLabel:'lame', name:'lame'},
{fieldLabel:'lame', name:'lame'},
{fieldLabel:'lame', name:'lame'},
{fieldLabel:'lame', name:'lame'},
{fieldLabel:'lame', name:'lame'},
{fieldLabel:'lame', name:'lame'}
]
}
]
};
var fp = {
xtype:'form',
items:[tp],
layout:'fit'
};
var w = new Ext.Window({
title:'test',
layout:'fit',
width:600,
height:200,
items:[fp]
});
w.show();
});

plalx
13 Oct 2010, 4:32 PM
autoScroll:true ... remove this, but if you want to be able to see everything, you will have to make your window bigger...


Ext.onReady(function() {

var fields = [], i, tp, win;

for (i = 0; i < 10; i++)
fields.push({});

tp = new Ext.TabPanel({
activeTab: 0,
items: [
{
title: 'Form',
xtype: 'form',
defaults: {
xtype: 'textfield',
fieldLabel: 'Test'
},
items: fields
}
]
});

win = new Ext.Window({
layout: 'fit',
height: 300,
width: 500,
items: [tp]
}).show();
});

jasonb885
13 Oct 2010, 4:37 PM
Yes, but the goal is to have autoScroll, otherwise, as you said, it's necessary to have a Window of ever increasing size as the form gains additional business items.

But perhaps there's no way to avoid that.

Animal
13 Oct 2010, 9:17 PM
defaults:{
layout:'form',
autoScroll: true
},

plalx
14 Oct 2010, 4:38 AM
Yes, but the goal is to have autoScroll, otherwise, as you said, it's necessary to have a Window of ever increasing size as the form gains additional business items.

But perhaps there's no way to avoid that.

Oh... right, somehow, I read that you did not wanted scrollbars at all hehe... Animal's solution should do it!

jasonb885
14 Oct 2010, 5:54 AM
That's embarrassingly obvious. I thought I'd done that originally. For some reason I kept wanting to scroll the TabPanel instead of the individual tabs, which doesn't even make sense.

Thanks.