Set fieldset height to auto : Form Fields « Ext JS « JavaScript DHTML






Set fieldset height to auto

   


<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() {
    var radioGroup = {
        xtype: 'fieldset',
        title: 'Groups',
        autoHeight: true,
        items: [
            {
                xtype: 'radiogroup',
                fieldLabel: 'Auto Layout',
                items: [
                    {boxLabel: 'Item 1', name: 'yourName', inputValue: 1},
                    {boxLabel: 'Item 2', name: 'yourName', inputValue: 2, checked: true},
                    {boxLabel: 'Item 3', name: 'yourName', inputValue: 3},
                    {boxLabel: 'Item 4', name: 'yourName', inputValue: 4},
                    {boxLabel: 'Item 5', name: 'yourName', inputValue: 5}
                ]
            }
        ]
    };
    var fp = new Ext.FormPanel({
        title: 'Title',
        frame: true,
        labelWidth: 110,
        width: 600,
        renderTo:Ext.getBody(),
        bodyStyle: 'padding:0 10px 0;',
        items: [
           radioGroup
        ],
        buttons: [{
            text: 'Save',
            handler: function(){
               if(fp.getForm().isValid()){
                    Ext.Msg.alert('asdf');
                }
            }
        },{
            text: 'Reset',
            handler: function(){
                fp.getForm().reset();
            }
        }]
    });


});
</script> 
<div id='div1'>asdf</div>
</body>
</html>

   
    
    
  








Related examples in the same category

1.Set field to typeahead to true
2.Indicate field as local
3.Set message target to under
4.Collapsed fieldset
5.Collapsible fieldset
6.Building new types of fields quickly
7.The Form demonstrates the use of radio buttons grouped by name being set by the value of the derived 'rating' field.
8.Load xml data for a Form
9.Form field: allowBlank
10.Call reset method to reset all fields on a form
11.Get form button by id
12.Spotlight Demo: restrict input to a particular element by masking all other page content