I’ve got a component, which extends from Ext.button.Button, and another component, wrappanel, which is responsible for laying out the custom button component.
My problem is, the wrappanel component calculates the width of the items being passed to it and requires item.el to be available. item.el is not available until the component has rendered, but rendering is deferred until all components are ready.
How can I ensure that my child component has its .el ready for use by the parent component? Thanks.
Calculating the width of child items is the responsibility of the layout manager, not the container. Depending on your version of Ext JS, however, writing a custom layout might be a tall order if you’re not comfortable with the codebase.
If you’re using 4.1.0 or later, take a look at Ext.layout.Context for the ultimate reference guide to the layout process. The 4.1 release marked a huge change to the layout system to address reports of performance issues, so the information there won’t help you if you’re using 4.0.7 or earlier.
The 4.1 layouts are much, much more difficult to wrap your head around (in my opinion), so I’d recommend trying to coax an existing layout to fill your requirements before trying to customize one. If you’re 4.0.7 or earlier it’s a bit easier, so you may have more flexibility there.