27 January 2009

IBM Design - iNotes for the iPhone

IBM Design - Design gallery: Software - iNotes on iPhone

Together at last! It actually looks to be a very, very well made app -- if I ever get my hands on an iPhone or iPod touch, I'd love to give this a try.

16 January 2009

Ubuntu and Its Leader Set Sights on the Mainstream - NYTimes.com

Ubuntu and Its Leader Set Sights on the Mainstream - NYTimes.com

A very timely story from the NY Times about Ubuntu! It's glad to hear that it's finally self-sustaining (when talking about revenue). Hell, that's more than a lot of companies can say today.

09 January 2009

Complex Conditional XTemplate Logic in ExtJS 2.2

Let's say you've got a bit of JSON data -- something like:

{
ReqPhoneSelection: "Primary",
ReqPrimaryPhone: "555-5555",
ReqAlt1Phone: "666-6666",
ReqAlt2Phone: "777-7777"
}

And you want to show just the one phone number as defined in "ReqPhoneSelection" in a fancy HTML template you've made in Ext.

How to do it? Well, you probably knew about ExtJS's conditional logic in the XTemplate system, but you know you have to check against strings for something like this, so how to do it when you've already used your single and double quote allotments for that line of JavaScript?

Why, as I learned here, just start escaping single quotes:

ReadModeTemplate = new Ext.XTemplate(
''
, '{ReqPrimaryPhone}'
, '
'
, ''
, '{ReqAlt1Phone}'
, '
'
, ''
, '{ReqAlt2Phone}'
, '
'
);

(Yeah, duh, right? Took me hours to figure that out, so hush up. :P)

Now, no matter what JSON data you put into that template, you'll only get out one number, depending upon what is stored in the "ReqPhoneSelection" property.