1
votes

I'm trying to display data in a Panel with this simple example with Sencha Touch 2, but it's not working :

var planetEarth = {
    name: "Earth",
    mass: 1.00
};

var planetInfo = new Ext.XTemplate("<h2>{name}</h2>mass: {mass}");

var profile = Ext.create('Ext.Panel', {
  fullscreen: true,
  xtype: 'panel',
  layout: 'fit',
  data : planetEarth,
  tpl: planetInfo
});

Ext.Viewport.setActiveItem(profile);

Any idea why ?

1

1 Answers

1
votes

Seems to work for me: http://www.senchafiddle.com/#KxGHo

[edit] To clarify, you need to wait until the document has finished loading before defining and executing any code that's used to build the user interface. Place your code in the application 'launch' method.