CheckBox is mainly used to receive the options selected by the user
as shown in the picture (please ignore the unsightly UI):
This popup The main code of the window 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 [fp] in items is the handle of the form.
is specifically defined 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: '100%',
hideEmptyLabel: false
},
items:[{
fieldLabel : 'Please select the reason for rejection:',
boxLabel: 'The form is not completed',
name:'integrity',
inputValue: '1'
}, {
name. :'correct',
boxLabel: 'The form is not filled in accurately',
inputValue: '1'
}]
}],
buttons: [
{text: 'Confirm', handler: function(){
//If the completeness and accuracy information is obtained, it will be 1, if 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 of interest. For details, please refer to the API. It is not difficult
Focus on getting the value of checkBox
console.log(fp.getForm().findField('integrity').getValue()?1:0);
console.log(fp.getForm().findField( 'correct').getValue()?1:0)
These two sentences are how to get the values of completeness and correctness.