PDA

View Full Version : [CLOSED] Accordion Layout - each sections header rendering bug.



pprabhu23
24 Feb 2012, 1:15 PM
I have an accordion layout into which 4-5 panels get added. The title for each panel , i.e each accordion section header title is dynamically set using the the panel's setTitle method. The accordion gets rendered with two headers with the titles printed twice.

I have looked at the examples and everything looks exactly the same..except that the title is dynamically set. I changed the example code for the accordion layout in 4.0.7 to set the last items title dynamically. It seems to cause an issue where the collapse toggle disappears. Not the same issue as mine but it appears something is getting messed up when the panel's title is set dynamically.


var item5 = Ext.create('Ext.Panel', {
title: 'Accordion Item 5',
html: '<empty panel>',
cls:'empty'
});

item5.setTitle('sdfsdfsd');

var accordion = Ext.create('Ext.Panel', {
region:'west',
margins:'5 0 5 5',
split:true,
width: 210,
layout:'accordion',
items: [item1, item2, item3, item4, item5]
});

I cant share my entire code ..as there is a lot. But the screenshot is attached. As you can see the title is STATUS 1..which gets printed on two generated headers and not one. This is an issue with ext 4.0.7 ..and did not happen on 4.0.2. I started getting this error after I made the upgrade.

Thanks!

mitchellsimoens
24 Feb 2012, 1:18 PM
Have you tried it with 4.1.0?

pprabhu23
24 Feb 2012, 2:55 PM
Yeah this looks like its fixed in 4.1.0. When is the 4.1.0 release due? I dont want to fix the rest of the application (lots of layout related stuff is broken) for 4.1.0 beta 2 and then have to do it for 4.1.0 stable release as well. So i ask when 4.1.0 can be expected to be released.

Thanks!

mitchellsimoens
25 Feb 2012, 7:49 AM
So far it looks to be mid to late March as a soft date.

findajit
27 Feb 2012, 7:34 AM
@pramod,

I would recommend you set the title after the panel is rendered as shown in the below code:


var pnl1 = Ext.create('Ext.panel.Panel',{
title: 'Panel 1',
html: 'Panel content!',
listeners: {
render: function(cmp) {
cmp.setTitle('Panel #1'); //setting the new title
}
}
});

This shall give you the desired output. I tried this with 4.0.7 and the result is positive.

Lesma
5 Jun 2012, 2:05 AM
Hello all! I have the same problem, when I dynamically set a title to accordion panels (double header).
I tried the solution posted by 'findajit' but it doesn't work :(