-
6 Aug 2009 12:32 PM #1
[TENT][3.0.0] Referencing child items when extending a container.
[TENT][3.0.0] Referencing child items when extending a container.
When I extend any container class and define items in initComponent() method, I cannot reference body properties of the items in either onRender() or afterRender() methods. Also I'm unable to reference a child item by a named reference created using ref config option specified on that item.
Please refer to this thread for code example to reproduce the defect and suggested solution by Animal:
http://extjs.com/forum/showthread.php?t=76829
Here's the copy of the code:
Thank you.PHP Code:MyPanel = Ext.extend(Ext.Panel, {
width: 500,
height: 500,
initComponent: function() {
var config = {
layout: 'border',
items: [{
region: 'west',
title: 'West',
html: 'blah blah',
width: 200,
split: true,
margins: '5 0 5 5'
}, {
region: 'center',
title: 'Center',
html: 'Lorem ipsum dolor sit amet...',
margins: '5 5 5 0',
itemId: 'center-region',
ref: '../centerRegion'
}]
};
Ext.apply(this, config);
MyPanel.superclass.initComponent.call(this);
},
afterRender: function() {
MyPanel.superclass.afterRender.apply(this, arguments);
console.log(this.body); // ok
console.log(this.getComponent('center-region')); // ok
console.log(this.getComponent('center-region').body); // undefined
console.log(this.centerRegion); // undefined
}
});
Eugene
Ext.Direct for ASP.NET MVC
-
6 Aug 2009 11:53 PM #2
Confirmed, this has been fixed in SVN.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
7 Aug 2009 4:46 PM #3
The change associated with this thread has caused other issues, opened in a new thread:
http://extjs.com/forum/showthread.ph...229#post370229MJ
API Search || Ext 3: docs-demo-upgrade guide || User Extension Repository
Frequently Asked Questions: FAQs
Tutorial: Grid (php/mysql/json) , Application Design and Structure || Extensions: MetaGrid, MessageWindow
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote