开发者

ExtJs Fieldset Collapsed issue

I have a fieldset with the option checkboxTog开发者_Python百科gle:true. When the user checks/unchecks the checkbox, I don't want the fieldset to expand/collapse.

How can I accomplish this?

Thanks in Advance


You can implement the beforecollapse event on the fieldset like in the code below. But this way you won't be able to collapse the fieldset.

Setting collapsible: false doesn't seem to work.

xtype:'fieldset',
checkboxToggle:true,
title: 'User Information',
autoHeight:true,
defaults: {width: 210},
defaultType: 'textfield',
items :[{
        fieldLabel: 'First Name',
        name: 'first',
        allowBlank:false
    },{
        fieldLabel: 'Last Name',
        name: 'last'
    },{
        fieldLabel: 'Company',
        name: 'company'
    }, {
        fieldLabel: 'Email',
        name: 'email',
        vtype:'email'
    }
],
listeners: {
    beforecollapse : function(p) {
        return false;
    }
}


or override Fieldset

Ext.override( Ext.form.FieldSet, {

    onCheckChange: function(cmp, checked) {
        if(this.collapsible) this.setExpanded(checked);
    }

});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜