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.