Hybrid View
-
22 Feb 2012 7:56 AM #1
[4.1 20120221] Expanding a panel in a border layout with dynamic content bug
[4.1 20120221] Expanding a panel in a border layout with dynamic content bug
Sorry the title couldn't be more descriptive. This is difficult bug to describe in the space allotted for the title.
In the sample below, there is a panel with border layout. The panel has a collapsed west region and the west region has a single child that updates its content in a render event.
Upon expanding the west region with the expand icon, the panel will have the normal header but the placeholder header will still be present. See attached picture.
Upon expanding the west region by clicking on the body of the placeholder header, two placeholder headers will be present. See attached picture.
If the west region is expanded by default, there is no problem.
Removing the update() call in the child panel restores the expected behavior.
Code:Ext.onReady(function() { Ext.create('Ext.panel.Panel', { width: 500, height: 400, x: 20, y: 20, title: 'Border Layout', layout: 'border', items: [{ title: 'Expand me please', region:'west', xtype: 'panel', width: 200, collapsible: true, collapsed: true, layout: 'fit', items: [{ title: 'Some Panel', listeners: { render: function() { this.update("I've been rendered!"); } } }] },{ title: 'Center Region', region: 'center' }], renderTo: Ext.getBody() }); });
-
22 Feb 2012 8:05 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
You should set the html config instead of updating it on render.
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.
-
22 Feb 2012 8:07 AM #3
That is a boiled down sample. Are you suggesting that there isn't a bug here?
-
22 Feb 2012 1:53 PM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
This only happens when it is trying to render. If you delay it 10ms it will not happen.
Code:Ext.create('Ext.panel.Panel', { width: 500, height: 400, x: 20, y: 20, title: 'Border Layout', layout: 'border', items: [{ title: 'Expand me please', region:'west', xtype: 'panel', width: 200, collapsible: true, collapsed: true, layout: 'fit', items: [{ title: 'Some Panel', listeners: { delay : 10, render: function() { this.update("I've been rendered!"); } } }] },{ title: 'Center Region', region: 'center' }], renderTo: Ext.getBody() });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.
-
22 Feb 2012 2:15 PM #5
I'm still not sure if you're telling me that this isn't a bug. Are you?
As to the workaround, it's not practical. The west region in my app has an accordion in it, and the accordion can contain several of many components. The components themselves don't know about the existence of the accordion or the existence of the west region. I can't be expected to delay every listener in every component I write just because it *might* end up in that west region, right?
The specifics of my app don't allow me to specify the HTML in the config because the content that I need to render depends on things that can change between the time the config is written and west region is expanded.
Also note that it's not just update() that can cause that problem. That was just the simplest way for me to narrow it down and demonstrate it.
-
22 Feb 2012 2:17 PM #6Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
I'm simply saying that the html config is a much better option than using update()
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.
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-5456
in
4.1.


Reply With Quote