Extjs 4.x Gets the value of the form checkbox check box _extjs

Source: Internet
Author: User
Checkboxes (check boxes) are used primarily to receive user-selected options

As shown in the picture (please ignore the UI's bad look):



The main code for the pop-up window is as follows:
Copy Code code as follows:

var win = new Ext.window ({
Modal:true,
Title: ' Are you sure you want to reject the table? ',
WIDTH:500,
Plain:true,
Items: [FP]
});
Win.show ();

The pop-up window is the carrier, and the [FP] inside the items is the handle to form forms.

The specific definition is as follows:
Copy Code code 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 sheet? ',
DefaultType: ' checkbox ',
Layout: ' Anchor ',
Defaults: {
Anchor: ' 100% ',
Hideemptylabel:false
},
items:[{
Fieldlabel: ' Please choose the reason for rejection: ',
Boxlabel: ' The table is not complete. ',
Name: ' Integrity ',
Inputvalue: ' 1 '
}, {
Name: ' Correct ',
Boxlabel: ' The table is not filled in accurately. ',
Inputvalue: ' 1 '
}]
}],
Buttons: [
{text: ' Confirm ', handler:function () {
The completeness and accuracy information is 1 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. The specific see API bar itself is not difficult

Focus on the value of the checkbox
Copy Code code as follows:

Console.log (Fp.getform (). FindField (' integrity '). GetValue ()? 1:0);
Console.log (Fp.getform (). FindField (' correct '). GetValue ()? 1:0)

These two words are the values of how to get integrity and correctness.

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.