Common Methods for learning ExtJS TextField

Source: Internet
Author: User

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 ());
}
});
});

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.