PDA

View Full Version : Change Ext.panel.Panel layout number of columns after render then doLayout



getbogged
1 May 2012, 8:10 AM
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?

getbogged
1 May 2012, 8:20 AM
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



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