Define and use radio button group : RadioButton « Ext JS « JavaScript DHTML






Define and use radio button group

  

<html>
<head>
<title>Hello World Window</title>
<link rel="stylesheet" type="text/css" href="ext-3.0.0/resources/css/ext-all.css" />
<script type="text/javascript" src="ext-3.0.0/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="ext-3.0.0/ext-all.js"></script>

</head>
<body>
<script type="text/javascript">
Ext.onReady(function() {
    Ext.QuickTips.init();
    
    var radios = [
      {
        xtype      : 'radio',
        fieldLabel : "",
        boxLabel   : 'A',
        name       : 'letter',
        inputValue : 'a'
      },
      {
        xtype          : 'radio',
        fieldLabel     : "",
        labelSeparator : ' ',
        boxLabel       : 'B',
        name           : 'letter',
        inputValue     : 'b'
      },
      {
        xtype          : 'radio',
        fieldLabel     : "",
        labelSeparator : ' ',
        boxLabel       : 'C',
        name           : 'letter',
        inputValue     : 'c'
      },
      {
        xtype          : 'radio',
        fieldLabel     : "",
        labelSeparator : ' ',
        boxLabel       : 'D',
        name           : 'letter',
        inputValue     : 'd'
      }
    ]
    
    var fp = {
      xtype      : 'form',
      labelWidth : 110,
      items      : radios,
      frame      : true
    }
        
    new Ext.Window({
      title   : '',
      layout  : 'fit',
      height  : 300,
      width   : 320,
      borde   : false,
      items   : fp
    }).show();
});
</script> 
<div id='div1'>asdf</div>
</body>
</html>

   
    
  








Related examples in the same category

1.Radio button type form field
2.Set inputValue for radio button
3.Mark one radioButton as checked
4.Set name for radio button