Search code examples
extjsiconsfieldset

extjs: fieldset-change collapse icon


how to change the expand/collapse icon of a fieldset component? by default it's a inverted triangle arrow, I want to set it as "+"/"-"? use "itemCls"?

thanks!


Solution

  • modify the css of the collapse button (in here background-position)

    here my css :

    #plus-min.x-panel-collapsed .x-tool-toggle{
        background-position: 0 -240px !important; /*the plus sign*/
    }
    #plus-min .x-tool-toggle{
        background-position: 0 -255px !important; /*the minus sign*/
    }
    

    and my fieldset :

    new Ext.form.FormPanel({
        renderTo : document.body,
        title : "asdasd",
        items :[{
                xtype:'fieldset',
                title: 'Plus Minus',
                collapsible: true,
                id : "plus-min",
                html : "asd",
                height : 100
            }]
    });