PDA

View Full Version : How-to: A quick guide for resolving issues from updating ST and broken custom themes



Greg Arnott
7 Apr 2013, 7:20 PM
So you've updated your project, got it all working using the new build methods, and find that it looks not quite right. Searching the viewed source, you find differences in the classes and wonder "wtf is going on?!".

You've tried searching the net for information, and maybe get lucky when one of your searches provides a tid-bit shining a light on the problem from a Sencha Blog post, a line from a release candidate note and a complaint on Stack Overflow.

Years ago when first starting using Sencha, occasionally I'd run into an issue. Reading docs and guides, often led to frustration as they were written by folks who knew what they were talking about, or contained non-existent references like Jesus Garcia's famous quote "As we'll cover later on". I'd forgotten what I'd learnt then, the primary method of resolving issues:

First Rule of Sencha: At any point there is one consistent answer - library source code.

Library source code is well documented and up to date. Fastest means to finding what you need is through http://docs.sencha.com > choose the library you're using > narrow search to issue item > hover mouse near heading or sub-elements for "view source..." and start reading.

A great example: an update from ST 2.0 to 2.1 and most of your theming problems resolve around your custom layout not displaying correctly. Open 2 browser windows to display the "before" and "after" of the default sencha styling source. In this case:
http://docs.sencha.com/touch/2-0/source/_layout.scss.html
http://docs.sencha.com/touch/2-1/source/_layout.scss.html

What becomes immediately apparent are the multiple changes in both interpretation and naming. ie:

x-docking-{orientation} now exists as x-dock-{orientation}.
layout handlers changed with x-size(d)(-monitored) and x-paint-monitored added.
x-layout-box given some loving.
By comparing the source of the old and the new and reading comments (where applicable) one can quickly attain a starting point towards the changes necessary to get your app updated and looking as it should.

mitchellsimoens
9 Apr 2013, 8:05 AM
I would caution about using the docs. The docs aren't shipped with the framework anymore (in 2.2) and the online docs may not be the version you are expecting.

People who have been around for a while always look in the actual source (in the src directory of what you download). The source is the best tool to learn, just most people are scared of it.