1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    24
    Answers
    2
    Vote Rating
    1
    getbogged is on a distinguished road

      0  

    Default Answered: Change Ext.panel.Panel layout number of columns after render then doLayout

    Answered: Change Ext.panel.Panel layout number of columns after render then doLayout


    Code:
    var grid = Ext.create('Ext.panel.Panel', {
                                    stateful: true,
                                    stateId: 'stateGrid',
                                    autoScroll: true,
                                    loadMask: mask,
                                    height: 700,
                                    buttons:[{
                                            xtype: 'textfield',
                                            name: 'save-name',
                                            id: 'save-name',
                                            fieldLabel: 'Save Name',
                                            allowBlank: false  // requires a non-empty value
                                    },{
                                            xtype: 'button',
                                            text: 'Save Bracket',
                                            iconCls: 'icon-group-go',
                                            height: 30,
                                            width: 100,
                                            arrowAlign: 'right',
                                            listeners:{
                                       //Stuff
                                            }],    
                                    width: 900,
                                    layout: {
                                        type: 'table',
                                        columns: cols 
                                    },
                                    
                                    items: [tour],
                                    bbar: [simpleCombo,loadBtn,deleteBtn],
                                    title: 'Create a Bracket',
                                    renderTo: 'grid-example',
                                    viewConfig: {
                                        stripeRows: true
                                    }
                                });
    I want to change the number of columns in this and then use a doLayout() to refresh then panel. I tried grid.reconfigure(); and grid.getLayout().reconfigure(); but i am not doing it correctly apparently. Thoughts?

  2. Yea so everything i have a question and post. I then find out i know the answer. Ill just wait a little longer before i post...

    Solution

    Code:
    grid.getLayout().columns = cols;
    grid.doLayout();

  3. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    24
    Answers
    2
    Vote Rating
    1
    getbogged is on a distinguished road

      0  

    Default


    Yea so everything i have a question and post. I then find out i know the answer. Ill just wait a little longer before i post...

    Solution

    Code:
    grid.getLayout().columns = cols;
    grid.doLayout();