jumpow
14 Jun 2013, 2:52 AM
I have next example of Accordion...
It opens page and firts item in accordion is open.
I can switch to other items, but first one is never collapsed. Why?
-----------------------------------
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' type='text/css' href='extjs/resources/css/ext-all.css'>
<script type='text/javascript' src='extjs/ext-all-debug.js'></script>
<script type="text/javascript">
Ext.application(
{
name: 'Alfa IVR Statistic',
launch: function()
{
Ext.BLANK_IMAGE_URL='extjs/resources/s.gif';
Ext.onReady(function()
{
var accordion = new Ext.Panel(
{
title: 'Accordion Layout',
layout:'accordion',
defaults:
{
collapsed: true,
// applied to each contained panel
bodyStyle: 'padding:15px',
flex : 1 // The sizes of panels are divided according to the flex index
},
items:
[ {
title: 'Panel 1',
collapsed:true,
html: '<p>Panel content!</p>'
},
{
title: 'Panel 2',
html: '<p>Panel content!</p>'
},
{
title: 'Panel 3',
html: '<p>Panel content!</p>'
}
]
});
var panel = new Ext.FormPanel(
{
id:'StFORM',
title : 'Test Accordion',
renderTo : 'SJPageMenu',
method: 'post',
style: 'background-color: #f3f0f3;',
items:
[
accordion
]
});
//-----------------------------------------------------------
});
}
});
</script>
</head>
<body>
<div id='SJPageMenu'></div>
</body>
</html>
It opens page and firts item in accordion is open.
I can switch to other items, but first one is never collapsed. Why?
-----------------------------------
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel='stylesheet' type='text/css' href='extjs/resources/css/ext-all.css'>
<script type='text/javascript' src='extjs/ext-all-debug.js'></script>
<script type="text/javascript">
Ext.application(
{
name: 'Alfa IVR Statistic',
launch: function()
{
Ext.BLANK_IMAGE_URL='extjs/resources/s.gif';
Ext.onReady(function()
{
var accordion = new Ext.Panel(
{
title: 'Accordion Layout',
layout:'accordion',
defaults:
{
collapsed: true,
// applied to each contained panel
bodyStyle: 'padding:15px',
flex : 1 // The sizes of panels are divided according to the flex index
},
items:
[ {
title: 'Panel 1',
collapsed:true,
html: '<p>Panel content!</p>'
},
{
title: 'Panel 2',
html: '<p>Panel content!</p>'
},
{
title: 'Panel 3',
html: '<p>Panel content!</p>'
}
]
});
var panel = new Ext.FormPanel(
{
id:'StFORM',
title : 'Test Accordion',
renderTo : 'SJPageMenu',
method: 'post',
style: 'background-color: #f3f0f3;',
items:
[
accordion
]
});
//-----------------------------------------------------------
});
}
});
</script>
</head>
<body>
<div id='SJPageMenu'></div>
</body>
</html>