-
29 Oct 2012 3:57 AM #1
[4.1.3] Accordion Layout not working when dynamically adding items
[4.1.3] Accordion Layout not working when dynamically adding items
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.3
- Chrome
- IE9
- FF
- n/a
- According Layout produces a weird handling, when items are added after instantiation. The accordion handling is totally broken then.
- create a Accordion Panel with items in it
- after the Panel is rendered, add another item the Accordion Panel
- added item will be handled in the accordion style..
- multiple items are expanded
- collapse/expand style within the accordion panel totally weird
I have enhanced the accordion layout example with a button in the center region to add a simple item the accordion panel...
Code:.. .. var viewport = Ext.create('Ext.Viewport', { layout : 'border' , items : [accordion , { region : 'center' , margins : '5 5 5 0' , cls : 'empty' , bodyStyle : 'background:#f1f1f1' , items : [{ xtype : 'button' , text : 'Add' , handler : function() { accordion.add({ xtype : 'panel' , title : 'added Accordion Item' , html : '<empty panel>' , cls : 'empty' }) } }] }] }); .. ..
HELPFUL INFORMATION
Screenshot or Video:See this URL for live test case: http://
Debugging already done:- none
- not provided
- only default ext-all.css
- custom css (include details)
- Windows
-
30 Oct 2012 1:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 435
Thank you for the report.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Nov 2012 3:05 AM #3
Here a temporary fix. Add this to your listeners of your items inside the accordion.
PHP Code:beforeexpand: function(e) {
e.ownerCt.items.each(function(item) {
if (item != e) item.collapse();
});
}
-
30 Jan 2013 1:52 AM #4
encounter the same problem
encounter the same problem
It can works in extjs-4.1.0, but when change to 4.1.3, the same problem is happen. Thanks!
-
2 Apr 2013 11:19 AM #5
Override
Override
Is there an override for this? The one mentioned above doesn't work. Also, I couldn't find the jira entry in any of the recent release notes.
-
14 May 2013 12:57 AM #6
I've got the same problem and didn't find any resolution yet.
The fix from stuchy didn't work for me.
Any ideas?
-
14 May 2013 1:07 AM #7
It's already fixed in 4.2.0 later, or you can override Ext.layout.container.Accordion class using 4.1.0 or 4.2.0 version
-
14 May 2013 1:10 AM #8
This works fine. Thanks a lot for your fast reply

-
14 May 2013 7:02 PM #9
work around
work around
I was able to get it working by adding by the following listener to each of my accordion items.
Code:// workaround for EXTJSIV-7642 (not working) listeners: { expand: function(item) { item.doLayout(); } } }
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-7642
in
4.2.0 Sprint 2.


Reply With Quote