Pages

Thursday, April 7, 2011

ExtJS -=- Items auto width in FormPanel

When you use a FormPanel with ExtJS 2.3, you cannot specify the layout type as "fit". If you specify "fit" you will lost all the labels of the items of your FormPanel.

If you want your items filling all the width of the container, you must use the anchor properties.

Here's a small example that shows a combobox using the anchor property and the width of the combo is 100% of the container...

{
     fieldLabel: 'Type',
     anchor: "100%",
     xtype: 'combo',
     typeAhead: true,
     mode: 'remote',
     minChars: 1,
     hiddenName: 'relationship[type_id]',
     triggerAction: 'all',
     store:  relationshipTypeStore
}

No comments:

Post a Comment