Results 1 to 2 of 2

Thread: open and close a fieldset by an other function

  1. #1

    Default open and close a fieldset by an other function

    Hallo Forum,
    ive got a formpanel with two fieldset-elements. now, i want that only one of them is open. SO i need i function, that closes the second one by opening the other one.

    can someone help me?

    thanks a lot

    HTML Code:
    klima = new Ext.FormPanel({
            frame:true,
            border:false,
            name:'klima',
            autoWidth: true,
            autoHeight: true,
            items: [{
                xtype:'fieldset',
                id:'manuelleAuswahl',
                title: 'manuelle Auswahl',
                autoHeight:true,
                defaults: {width: 210},
                defaultType: 'textfield',
                collapsible: true,
                collapsed: true,
    	          html:'<table><tr><td class="kursiv">Stationsauswahl:</td><td><div id="timtest"></div></td></tr></table>',
                items :[jahresauswahl2 ]
            },{
                xtype:'fieldset',
                title: 'dynamischer kartenmodus', 
                autoHeight:true,
                id:'kartenAuswahl',
                defaults: {width: 210},
                defaultType: 'textfield',
                collapsible: true,
                collapsed: true,
                items :[jahresauswahl, stationsanzeige ]
            }]
        });

  2. #2
    Ext JS Premium Member
    Join Date
    Jan 2010
    Location
    Austria
    Posts
    87

    Default

    fieldset has expand and collapse listeners.

    something like this should do what you want
    Code:
    var fieldset1 = 
    klima = new Ext.FormPanel({
            ...
            items: [{
                xtype:'fieldset',
                id:'manuelleAuswahl',
                items :[jahresauswahl2 ],
                ....
                listeners: {
                    collapse: function(panel){
                        klima.findById('kartenAuswahl').expand();
                    }
                }
            },{
                xtype:'fieldset',
                title: 'dynamischer kartenmodus', 
                listeners:{
                    collapse: function(panel){
                        klima.findById('manuelleAuswahl').expand();
                    }
                }
            }]
        });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •