PDA

View Full Version : FormPanel autoScroll trouble



Rencom
8 Jun 2010, 2:44 AM
I have extjs-application, main window based on Viewport, to center region i put forms/grids depends on user choice.

So, for center panel i set layout 'fit' and autoScroll = true. I dont have problem with gridpanel, treepanel, but FormPanel doesnt wanna work properly. It definitely hides overflow content. See screenshot.
http://support.mweb.ru/extjs-formpanel.png


Any suggestion to solve this trouble with overflow content?

evant
8 Jun 2010, 2:49 AM
Need to show the relevant code.

Animal
8 Jun 2010, 2:53 AM
layout: 'fit' plus autoScroll: true is meaningless.

Think about it.

The single child item is sized to exactly fit. So there can be no scrolling.

It's the FormPanel itself which must be autoScroll: true because that is having its height cut down. (By its parent's fit layout)

Rencom
8 Jun 2010, 2:58 AM
My custom form panel:


Application.SettingsForm = Ext.extend(Ext.FormPanel, {

initComponent: function(){

Ext.apply(this, {
url: '/settings/save_settings',
method: 'POST',
autoScroll: true,
layout: 'fit',
title: 'Settings'
});


Application.SettingsForm.superclass.initComponent.apply(this, arguments);
},
.....
}

Viewport panel:

new Ext.Viewport({
layout:'border',
id: 'viewport-id',
items:[{
region:'west',
layout:'accordion',
....
},{
region:'center',
margins:'60 5 5 0',
layout:'fit'//,
//autoScroll:true
}]
});


I know, i put double times layout 'fit'... i've tried a lot of combinations :-)

Then i add my custom form panel to viewport like this:


center_panel = Ext.getCmp('viewport-id').getComponent(1);
center_panel.add( /*here object of Application.SettingsForm */ );
center_panel.doLayout();

Rencom
8 Jun 2010, 3:03 AM
Animal: i've tried set to form panel autoScroll: true and layout: form (as default) and 'fit' layout to center region, but it doesnt wanna work) or i didnt understand you? You can see code above.

Animal
8 Jun 2010, 3:06 AM
It will work with the center as layout: 'fit' and the form as autoScroll: true

Rencom
8 Jun 2010, 3:26 AM
Animal, it works with treepanel, gridpanel and etc. but doesnt work with FormPanel. All of them inherited from Panel class. So, problem incapsulated in FormPanel class i guess ((

Rencom
8 Jun 2010, 5:27 AM
how to force formpanel dont fix bbar panel with control buttons?

Animal
8 Jun 2010, 6:05 AM
It does work. You are doing something we can't see.

Rencom
8 Jun 2010, 8:30 AM
Animal, i did it) it almost work as i want. I want buttons to be in the same 'frame' (block) with input fields. How can i get it without 'autoHeight: true'? Right now i have something like this:
http://support.mweb.ru/extjs-formpanel-2.png

Animal
8 Jun 2010, 9:43 AM
You were using autoHeight?

http://i131.photobucket.com/albums/p286/TimeTrialAnimal/autoHeightDocs.jpg

You want the Submit buttons to be part of the form? And scroll with the form? Won't that be very irritating to the users?

Rencom
8 Jun 2010, 10:24 AM
You want the Submit buttons to be part of the form? And scroll with the form?

that exactly what i want.


Won't that be very irritating to the users?

i dont want things like this (a lot of white space between fields and buttons):
http://support.mweb.ru/extjs-formpanel-3.png