1. #1
    Sencha User
    Join Date
    Feb 2010
    Posts
    9
    Vote Rating
    0
    smdvq is on a distinguished road

      0  

    Default LayoutConfig problem

    LayoutConfig problem


    Hi,

    i am new to extjs. I am looking for a function to setLayoutConfig on the fly. For example: i have button and after click i want to change accordion layoutConfig. Functions like setLayoutConfig() or setLayout() do not work or i am doing smth wrong. Changing title works perfectly. Here is code:

    Code:
    var setAccordionStyle = function (menuItem, checked) {
            if (checked == true){
                var type = menuItem.text.toLowerCase();
                
                Ext.getCmp('east-panel').setTitle('East Region - Acc style: '  + menuItem.text);
                            
                if (type == 'standard'){
                    Ext.getCmp('east-panel').setLayoutConfig({
                        titleCollapse: false,
                        animate: true,
                    })
                }else if (type == 'noeffect'){
                    Ext.getCmp('east-panel').setLayoutConfig({
                        titleCollapse: false,
                        animate: false
                    })
                }else if (type == 'ontop'){
                    Ext.getCmp('east-panel').setLayoutConfig({
                        titleCollapse: false,
                        animate: true,
                        activeOnTop: true
                    })
                }
            }
        }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    33,582
    Vote Rating
    434
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    Have you tried looking at the hbox or vbox demo? In a click of a button, they change the layoutConfigs and I think that is pretty much what you're talking about. It uses the replace function
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Feb 2010
    Posts
    9
    Vote Rating
    0
    smdvq is on a distinguished road

      0  

    Default


    This is not what i want. I dont want to remove whole panel and make it again with only layout changed. I want to change only layoutConfig without removing then adding item to container. Is this possible??