Extjs4.x get the value of the formCheckBox check box _ extjs

Source: Internet
Author: User
CheckBox (check box) is mainly used to receive options selected by the user. How can we get the value of formCheckBox through Extjs4.x? The following is a good method. It is worth noting that the CheckBox (check box) is mainly used to receive the options selected by the user.

(Ignore the poor UI view ):



The main code for this pop-up window is as follows:

The Code is as follows:


Var win = new Ext. Window ({
Modal: true,
Title: 'Are you sure you want to reject this table? ',
Width: 500,
Plain: true,
Items: [fp]
});
Win. show ();


The pop-up window is the carrier, and the [fp] in items is the form handle.

The specific definition is as follows:

The Code is as follows:


Var fp = Ext. create ('ext. FormPanel ',{
Frame: true,
FieldDefaults :{
LabelWidth: 110
},
Width: 500,
BodyPadding: 10,
Items :[
{
Xtype: 'fieldset ',
Flex: 1,
// Title: 'Are you sure you want to reject this table? ',
DefaultType: 'checkbox ',
Layout: 'anchor ',
Defaults :{
Anchor: '20140901 ',
HideEmptyLabel: false
},
Items :[{
FieldLabel: 'select the reason for rejection :',
BoxLabel: 'This table is not complete. ',
Name: 'integration ',
InputValue: '1'
},{
Name: 'correct ',
BoxLabel: 'This table is incorrect. ',
InputValue: '1'
}]
}],
Buttons :[
{Text: 'confirmed', handler: function (){
// If the integrity and accuracy information is obtained, the value 1 is not 0.
If (fp. getForm (). isValid ()){
Console. log (fp. getForm (). findField ('integrity'). getValue ()? 1-0 );
Console. log (fp. getForm (). findField ('correct'). getValue ()? 1-0)
}
Win. hide ();
}
},{
Text: 'cancel ',
Handler: function (){
Win. hide ();
}
}]
});


This basically covers all the information you are interested in. For details, see the API itself.

The checkBox value is obtained.

The Code is as follows:


Console. log (fp. getForm (). findField ('integrity'). getValue ()? 1-0 );
Console. log (fp. getForm (). findField ('correct'). getValue ()? 1-0)


These two statements are about how to obtain the integrity and correctness values.
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.