English 中文(简体)
Using XTempate with Sencha Touch 2
原标题:

So working though the mostly absent docs on templates - unable to get it to work.

Ext.define( MyAPp.view.Login , {
    extend:  Ext.Component ,
    xtype:  welcomeLogin ,
    config: {
        html:  This shows ,
        tpl:   Ext.create ( Ext.XTemplate ,  <div>Please show something</div> , {
            compiled: true
       })
     }

});

Why does the template content now show? I have tried adding apply(), applyTemplate() on and on and on... Please help!!!

最佳回答

@ilija139 is right. you need to define the data property, even if it s empty.

data: {}

Edit: Also, the compile attribute isn t needed. It only applies to Ext.Templates not XTemplates (according to the docs). Works the same for me without compile

问题回答

暂无回答




相关问题
Windows 7 multitouch capabilities with HTML5

I have a problem: There are HTML5/CSS3 mobile frameworks on the market like Sencha Touch and Phonegap which can use the multi-touch gestures of the iPad/iPhone, Android, etc. That s working fine, I ...

Getting started with Sencha Touch

I m an Ext veteran but have a few rather simple mobile apps i need to create and naturally i m looking at sencha touch. Ting is - most of the examples don t run up in Firefox/Opera. I m happily using ...

Custom icon in TabPanel fails

I m trying to add a custom icon to a TabPanel but when I do that it just shows a dark box with rounded corners. My css looks like this: http://pastebin.org/447682 The code in the url is base64 for ...

Sencha Touch and ExtJS

Sencha Touch looks impressive, and ExtJS looks nice. I am evaluating if I should use ExtJS or SproutCore for an upcoming app. Now that Sencha Touch is in the mix, I wonder if I choose ExtJS, it d be ...

Turning Sencha Touch-based app into a true native iPhone app?

As I understand, Sencha Touch is just a javascript library that lets you create websites that respond to multitouch and other features you find in native iPhone apps. So... Your end result is accessed ...

Is anyone using Sencha Touch for mobile development?

We re evaluating Sencha Touch for mobile development. Has anyone used this yet (I realize that it s still in beta), and if so, what are its strengths / weaknesses? How does it compare to alternatives? ...

热门标签