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)

ExtJS vs. AngularJS

I’ve been meaning to say a few words about this for a long time: stop comparing ExtJS to AngularJS!

It’s like comparing a car to a tire:

  • One is not better than the other; it’s an invalid comparison
  • If you need a car, you probably shouldn’t buy just the tire
  • If you need just a tire, you probably shouldn’t buy an entire car

Consider this: minified version of ExtJS 4.2.2 is 1.4 MB (ext-all.js) and that’s not counting all the CSS and resources. By contrast, AngularJS 1.2.13 is just over 100 KB.

Now when I’m calling AngularJS a “tire” what I mean is that if you are building an app of any magnitude, you will probably be bundling it with some other libraries. I’m guessing many newer apps will have a bare minimum of AngularJS + jQuery + Bootstrap.

So, when would I chose one over the other, if I were equally proficient in both?

  1. If an important objective is fast page load times (i.e. landing page), I would go with a lean stack on top of AngularJS
  2. However, if I’m building an enterprise portal with a ton of UI and functionality, I would probably go with ExtJS
  3. Now how about both? I’ve built apps that had a lean landing page with just jQuery that would then transition to the “app” in ExtJS; I think LastPass is an excellent example of that.
VN:F [1.9.22_1171]
Rating: 10.0/10 (10 votes cast)

Illuminations for Chrome!

A few years ago I wrote about ExtJS4 Dev Tools of a Pro, where I mentioned a FireFox plugin called Illuminations. Since then I’ve switched to Chrome as my dev platform where I missed my cherished Illuminations plugin.

I believe only last week the creators of FF’s plugin have released a version for Chrome: https://chrome.google.com/webstore/detail/illuminations/hbhnkfhblakpfhcpepeoogmakimflibk

It doesn’t feel like a full port, but it does have the one feature I care most about: similar to how you can right-click on a page and “Inspect Element” to bring up dev tools and pinpoint the target in the DOM tree, you can now right-click and “Illuminate:”

illuminate1

At which point you will pinpoint the target in the Ext component tree:

illuminate2

Combined with Sencha Inspector for Chrome, the Chrome browser is now a powerhouse for ExtJS/Sencha Touch development!

VN:F [1.9.22_1171]
Rating: 10.0/10 (3 votes cast)

ExtJS vs. Touch Config System

In this example I will demonstrate the difference between how ExtJS 4 and Sencha Touch 2 config systems treat non-primitives (i.e. arrays or objects). This aspect of the frameworks is very important to distinguish as it will save you from some very painful debugging sessions.

Long story short, Touch will actually clone any objects from the config for every instance of your class, whereas ExtJS will slap them on the prototype (probably not what you want).

Now for a practical example.
Continue reading ExtJS vs. Touch Config System

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

Touch 2.2.x is broken in Chrome 29

Chrome 29 came out just two days ago and it appears Sencha Touch 2.2.x projects don’t display properly. I’m not sure if it affects mobile Chrome browsers (I assume it would, once they update, but they do lag behind the desktop browser in that department).

A fix posted by Steve Drucker on his blog: http://druckit.wordpress.com/2013/08/22/sencha-touch-2-x-and-google-chrome-29/

Just change the st-box mixin inside of:

/touch2/resources/themes/stylesheets/sencha-touch/base/mixins/_Class.scss

…and recompile the SASS. The new code:

@mixin st-box($important: no) {
    @if $important == important {
        display: flex !important;
        display: -webkit-box !important;
        display: -ms-flexbox !important;
    } @else {
        display: flex;
        display: -webkit-box;
        display: -ms-flexbox;
    }
}
VN:F [1.9.22_1171]
Rating: 10.0/10 (2 votes cast)