setItemTpl is working on xtype list but the same template is not working using setTpl on a container, label, etc.

Example:



Code:



var data = {
"version": 1;
};

//if el is an xtype list, the following code works
el.setData(data);
var tpl = new Ext.XTemplate('<div>{version}</div>')
el.setItemTpl(tpl);

//if el is an xtype label, container, etc. the following code does not work
el.setData(data);
var tpl = new Ext.XTemplate('<div>{version}</div>')
el.setTpl(tpl);

//So instead I have been doing this workaround for labels, containers, etc. However, I need it to be a template for future use
el.setData(data);
var tpl = new Ext.XTemplate('<div>{version}</div>')
el.setHtml(tpl.apply(data));

;

I have played with this for a long time and even this doesn't work on label and container xtypes



Code:



el.setData(data);
el.setTpl('<div>testing</div>');

I am using Sencha Touch 2.3.1