1. Form layout is composed of class Ext. layout. formLayout is defined as form, which is used to manage the layout of input fields in a form. This layout is mainly used to create form fields or form elements in a program.
HideLabels: tru indicates to hide tags. The default value is false.
LabelAlign: The tag teams are left, right, and center. The default value is left.
Copy codeThe Code is as follows: Ext. onReady (function (){
Var _ panel = new Ext. Panel ({
Title: "personnel information ",
RenderTo: Ext. getBody (),
Frame: true,
Width: 500,
Height: 300,
Layout: "form ",
HideLabels: false,
LabelAlign: "right ",
Height: 120,
DefaultType: 'textfield ',
Items :[
{FieldLabel: "name", name: "name "},
{FieldLabel: "Enter the address", name: "address "},
{FieldLabel: "Enter the phone number", name: "tel "}
]
}
);
Ii. In practical applications, the Ext. form. FormPanel class uses the Form layout by default. Therefore, we can directly use FormPanel. The preceding example can be rewritten as follows:Copy codeThe Code is as follows: Ext. onReady (function (){
Var _ panel = new Ext. FormPanel ({
Title: "personnel information ",
RenderTo: Ext. getBody (),
Frame: true,
Width: 500,
Height: 300,
HideLabels: false,
LabelAlign: "right ",
Height: 120,
DefaultType: 'textfield ',
Items :[
{FieldLabel: "name", name: "name "},
{FieldLabel: "Enter the address", name: "address "},
{FieldLabel: "Enter the phone number", name: "tel "}
]
}
);