I've been working with Sencha Touch lately and I've been impressed with it so far. It's a really nice full-stack solution for HTML5 mobile web development. There was however a pain point I came across that I needed to solve.
Fortunately I was able to hack together a quick and dirty workaround for this based off Hogan.js, Twitter's Mustache-compatible HTML templating system. First I wrote a simple HTML template named myTemplate.mustache:
Then I edited my main HTML file to include the Hogan library and my compiled templates:
Next I wrote a subclass of Ext's XTemplate to serve as an adapter between their template API and Hogan's. I haven't tested this very thoroughly yet; there are likely a bunch of other methods that need overriding to get this solid:
And then updated the original code snippet to use the following:
and presto, it just works :)
Adapting this for Mustache.js should be straightforward provided they expose a similar API with a synchronous render() method.