PDA

View Full Version : Should auto container layout be avoided?



_uknownot
18 Aug 2014, 9:35 PM
According to this article - http://www.sencha.com/blog/inside-the-ext-js-4-1-layout-system containers that do not explicitly specify a layout default to "Auto" layout. Containers using this layout use an "auto-size" size model (either natural or shrinkwrap), which can impact performance.

Is this correct? Should containers always explicitly specify a layout (i.e. avoid the default auto layout as much as possible)?

skirtle
19 Aug 2014, 12:51 PM
I'm not clear on the performance implications but your conclusion is correct, you should always specify a layout. If you use an auto layout you're relying on CSS to position things. In some rare circumstances that might be what you want but it can lead to inconsistent results across browsers. Even if you do want to use an auto layout I'd suggest explicitly specifying it in your code so it's clear you haven't forgotten to include a layout.