rkim
17 Jan 2012, 11:19 AM
I am saving last open accordion tab into cookie, and expand when page load
as below.
The second accordion expands fine, but first item cannot be opened anymore. If you remove the expand code, accordion works fine.
Is there any method that opens accordion item other than expand ? or is it a bug ?
listeners:
{
"afterrender":function()
{
var activeItem = Ext.getCmp("accordion_2"); //the last expanded item
if (activeItem)
activeItem.expand();
}
}
Ext.onReady(function()
{
var myBorderPanel = Ext.create("Ext.container.Viewport",
{
layout: "border",
margin:"0 0 0 0",
defaults:{border:false,header:false,defaults:{border:false}},
items: [
{
id:"westPanel",
region: "west",
collapsible: true,
collapseMode : "mini",
split: true, // enable resizing
layout:"fit",
width:250,
items:[
{
xtype:"panel",
layout:"accordion",
animate:false,
items:[
{
id:"accordion_1",
title:"accordion1"
},
{
id:"accordion_2",
title:"accordion2"
},
{
id:"accordion_3",
title:"accordion3"
}
]
}],
listeners:
{
"afterrender":function()
{
var activeItem = Ext.getCmp("accordion_2"); //the last expanded item
if (activeItem)
activeItem.expand();
}
}
},
{
id:"centerPanel",
region: "center", // center region is required, no width/height specified
margins: "0 5 0 0",
layout:"border",
autoScroll:false,
items:[]
}]
});
});
as below.
The second accordion expands fine, but first item cannot be opened anymore. If you remove the expand code, accordion works fine.
Is there any method that opens accordion item other than expand ? or is it a bug ?
listeners:
{
"afterrender":function()
{
var activeItem = Ext.getCmp("accordion_2"); //the last expanded item
if (activeItem)
activeItem.expand();
}
}
Ext.onReady(function()
{
var myBorderPanel = Ext.create("Ext.container.Viewport",
{
layout: "border",
margin:"0 0 0 0",
defaults:{border:false,header:false,defaults:{border:false}},
items: [
{
id:"westPanel",
region: "west",
collapsible: true,
collapseMode : "mini",
split: true, // enable resizing
layout:"fit",
width:250,
items:[
{
xtype:"panel",
layout:"accordion",
animate:false,
items:[
{
id:"accordion_1",
title:"accordion1"
},
{
id:"accordion_2",
title:"accordion2"
},
{
id:"accordion_3",
title:"accordion3"
}
]
}],
listeners:
{
"afterrender":function()
{
var activeItem = Ext.getCmp("accordion_2"); //the last expanded item
if (activeItem)
activeItem.expand();
}
}
},
{
id:"centerPanel",
region: "center", // center region is required, no width/height specified
margins: "0 5 0 0",
layout:"border",
autoScroll:false,
items:[]
}]
});
});