将复选框更改为单选按钮组ExtJS

时间:2014-10-09 19:30:21

标签: javascript jquery extjs

我是Ext JS的新手。我有这组复选框可以正常工作,但我需要将它们更改为Radio按钮并保留其功能。如果你能帮助我,我会很感激。我再次成为EXT JS的新手。我制作了field.Radio,但仍允许选择所有这些。请帮忙:

var employeeBox = Ext.create('Ext.form.field.Radio', {
         id:'employeeBox',
             fieldLabel: 'Employee Group:',
           labelAlign:'left'
         });


       var mpBox = Ext.create('Ext.form.field.Radio', {
         id:'mpBox',
             fieldLabel: 'Market Particpants Group:',
           labelAlign:'left'
         });


       var committeeBox = Ext.create('Ext.form.field.Radio', {
         id:'committeeBox',
             fieldLabel: 'Committee Group:',
           labelAlign:'left'
         });

1 个答案:

答案 0 :(得分:3)

您需要为所有人添加相同的名称。例如:

   var employeeBox = Ext.create('Ext.form.field.Radio', {
         id:'employeeBox',
         name: 'group',
         fieldLabel: 'Employee Group:',
         labelAlign:'left'
   });


   var mpBox = Ext.create('Ext.form.field.Radio', {
         id:'mpBox',
         name: 'group',
         fieldLabel: 'Market Particpants Group:',
         labelAlign:'left'
   });


   var committeeBox = Ext.create('Ext.form.field.Radio', {
        id:'committeeBox',
        name: 'group',
        fieldLabel: 'Committee Group:',
        labelAlign:'left'
   });