I. Attributes
FieldLabel: Label name.
LabelWidth: Label width.
ID: the ID of the file box.
Ii. Construction Parameters
Listeners: binds a series of events before object initialization.
Iii. Functions
GetCmp (string _ id): component object whose id is _ id.
GetValue (): Get the file box value.
4. Others
Layout: only in this layout can the label name of the file box be correctly displayed. The layout Host object must be
Is a subclass of Ext. Container or Ext. Container.
When applying the FormLayout layout, you only need to specify layout: "form" in the constructor of the Host object.
V. Application Examples
Copy codeThe Code is as follows:
Ext. onReady (function (){
Var _ panel = new Ext. Panel ({
RenderTo: Ext. getBody (),
Layout: "form ",
LabelWidth: 30,
Listeners :{
"Render": function (_ panel ){
_ Panel. add (new Ext. form. TextField ({
Id: "txt_name ",
FieldLabel: "name"
}));
}
}});
New Ext. Button ({
Text: "OK ",
RenderTo: Ext. getBody (),
Handler: function (){
Alert (Ext. getCmp ("txt_name"). getValue ());
}
});
});