PDA

View Full Version : LayoutConfig problem



smdvq
10 Feb 2010, 2:50 PM
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:


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
})
}
}
}

mitchellsimoens
10 Feb 2010, 5:04 PM
Have you tried looking at the hbox (http://www.extjs.com/deploy/dev/examples/layout/hbox.html) or vbox (http://www.extjs.com/deploy/dev/examples/layout/vbox.html) 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

smdvq
10 Feb 2010, 11:08 PM
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??