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