shrinkWrap in ExtJS 4 and 5 Containers

ExtJS Containers and Panels are typically sized by their parent container’s layout. Traveling up the layout chain typically leads to a Viewport, which occupies the available screen space; i.e. (view in Sencha Fiddle):

sample viewport

Now what about those times when you want to use these beautiful panels as the actual content, rather than as holders of other content? In other words, how can we make the Panels size based on their content (rather than as dictated by their parent’s layout)? The end result might look something like this:

sample panel shrinkWrap

Read on to find out how its done and what caveats exist…

Continue reading shrinkWrap in ExtJS 4 and 5 Containers

VN:F [1.9.22_1171]
Rating: 9.4/10 (7 votes cast)