PDA

View Full Version : Accordion initalSize and collapse:false



steffenk
4 Aug 2007, 12:22 PM
When setting for first tab is collapsed:false and initialHeight of accordion the other tabs are not visible on first load



Ext.onReady(function() {
// create accordion
var acc = new Ext.ux.Accordion('acc-hx', {
fitContainer: true
, fitToFrame: true
, fitHeight: true
, initialHeight: 240
, desktop: 'center-accordions'
, animate: false
})

// create panels
var panel1 = acc.add(new Ext.ux.InfoPanel('panel-hx1', {
icon: 'fileadmin/template/neu/img/icons/freunde.gif'
, collapsed:false
}));
var panel2 = acc.add(new Ext.ux.InfoPanel('panel-hx2', {
icon: 'fileadmin/template/neu/img/icons/gruppen.gif'
}));
var panel3 = acc.add(new Ext.ux.InfoPanel('panel-hx3', {
icon: 'fileadmin/template/neu/img/icons/events.gif'
}));
var panel4 = acc.add(new Ext.ux.InfoPanel('panel-hx4', {
icon: 'fileadmin/template/neu/img/icons/info.gif'
}));
});


does anybody knows how to fix ? thx

jsakalos
6 Aug 2007, 3:43 PM
When setting for first tab is collapsed:false and initialHeight of accordion the other tabs are not visible on first load



Ext.onReady(function() {
// create accordion
var acc = new Ext.ux.Accordion('acc-hx', {
fitContainer: true
, fitToFrame: true
, fitHeight: true
, initialHeight: 240
, desktop: 'center-accordions'
, animate: false
})

// create panels
var panel1 = acc.add(new Ext.ux.InfoPanel('panel-hx1', {
icon: 'fileadmin/template/neu/img/icons/freunde.gif'
, collapsed:false
}));
var panel2 = acc.add(new Ext.ux.InfoPanel('panel-hx2', {
icon: 'fileadmin/template/neu/img/icons/gruppen.gif'
}));
var panel3 = acc.add(new Ext.ux.InfoPanel('panel-hx3', {
icon: 'fileadmin/template/neu/img/icons/events.gif'
}));
var panel4 = acc.add(new Ext.ux.InfoPanel('panel-hx4', {
icon: 'fileadmin/template/neu/img/icons/info.gif'
}));
});
does anybody knows how to fix ? thx

Try to call acc.setPanelHeight() after adding all panels.

steffenk
7 Aug 2007, 12:38 AM
thanks Jozef, that works ;)