Q:

In Sencha Touch 2 binding data to tpl with Panel not working

I am new to Sencha Touch and trying Sencha Touch version 2 for a demo of xtemplates. This is what I have code.
Ext.application({
  name: 'Templates',

  launch: function(){
    var content, planetInfo, planetEarth;

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

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

    content = new Ext.Panel({
      fullscreen: true,
      scroll: 'vertical',
      tpl: planetInfo
    });

    content.update(planetEarth);
  }
});

output for this code should be in HTML format in the panel. But I just get [object Object]. Please help.

A:

Don't use content.update(planetEarth) method, because it is deprecated in sencha-touch-2.
Here is an example of the correct code:
Ext.application({
        name: 'Templates',

        launch: function() {
            var content, planetInfo, planetEarth;

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

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

            content = Ext.create("Ext.Panel", {
                fullscreen: true,
                scroll: 'vertical',
                tpl: planetInfo,
                data: planetEarth
            });
        }
    });

