ExtJS 4.2 radiogroup usage of data control

Source: Internet
Author: User

Recently in the EXTJS4.2 development project, the use of radiogroup, mainly with the editing function between the grid; Read a lot of information is wrong, hereby here notes record

Code as follows,

1. This is the two radio button on a win form, and the Set radio button is select Yes

A

{xtype:'Fieldcontainer', layout:'Hbox', defaults: {Flex:1}, items: [{xtype:'Radiogroup',Fieldlabel:'Mobile Verification', Width: -, items: [{boxlabel:'is a', Name:'phonevalidate', Inputvalue:'true',checked:true}, {boxlabel:'No', Name:'phonevalidate', Inputvalue:'false'}]}, {xtype:'Radiogroup',Fieldlabel:'Mailbox Verification', Width: -, items: [{boxlabel:'is a', Name:'emailvalidate', Inputvalue:'true',checked:true}, {boxlabel:'No', Name:'emailvalidate', Inputvalue:'false', }                   ] }               ]           }

B, error code:

2.grid Line Operation code:

{header:'Operation', Xtype:'Actioncolumn', Width: -, items: [{//This icon is set directly through the URL .Icon'/resources/images/16x16/blue16_020.gif', tooltip:'Edit',                            //here is the Click event of the icon//there is a record of the clicked Row in the parameter, so it is convenient to handlehandler:function (grid, RowIndex, Colindex) {update (); }                        }, '   ', {icon:'/resources/images/16x16/blue16_013.gif', tooltip:'Delete', Handler:function (grid, RowIndex, Colindex) {deleted (); }                        }]                    }

3.update () code snippet:

function Update () {varSelecteddata = Grid.getselectionmodel (). GetSelection () [0].data; if(Selecteddata.length <1) {Ext.MessageBox.alert ('Tips','Please select the record you want to edit! ');return; } Else{win.show ();//This is the popup formForm.form.loadRecord (Grid.getselectionmodel (). GetSelection () [0]); Form.form.findField ('phonevalidate'). SetValue ('false');//This cell phone verification radio buttonForm.form.findField ('emailvalidate'). SetValue ('false');//This mailbox verification radio button                   }    }

4. Eject:

ExtJS 4.2 Data Control Radiogroup usage

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.